Przeprawiona klasa tworzenia kontenerów. Dodano funkcję która wygodnie dobiera odpowiednie działanie dla danych

This commit is contained in:
yanczi 2025-11-07 16:38:19 +01:00
parent 31f08e52d0
commit 8402ce1b65
7 changed files with 84 additions and 33 deletions

View file

@ -40,33 +40,32 @@ void RenderHelp()
const std::string HelpInstruction =
"pakcmd <parametr> <catalog> \n"
" \n"
" -c Pack and compress with LZ4 \n"
" -p Pack files from the specified directory \n"
" -e Pack and encrypted from the specified directory \n"
" -f Pack the files according to the guidelines given in the <directory>.txt \n"
" -s Pack and encrypted \n"
" -cs Pack and compress \n"
" \-c Compressing \n"
" \-r Raw files \n"
" \-e Encrypted \n"
" \-s Compressing and Encrypted \n"
" \-f Pack the files according to the guidelines given in the \<directory\>.json \n"
" \n"
"Extracting: \n"
" -x Extract files from the specified container \n"
" \n"
"Others: \n"
" -ls List files stored in a container \n"
" \n"
" \n"
"<catalog>.txt \n"
"<catalog>.json \n"
" \n"
"Keys: \n"
" \n"
" {compress} - Compressing files \n"
" {crypt} - Encrypted files with ChaCha20 \n"
" {compress} - Compressing files \n"
" {crypt} - Encrypted files \n"
" {ignore} - Ignoring concrete files \n"
" \n"
" /path/to/file.ext - Concrete file \n"
" *.ext - All files with concrete extension \n"
" *.* - All files !NOT WORKING WITH {ignore} KEY! \n"
" \n";
" *.* - All files !NOT WORKING WITH {ignore} KEY! \n";
Interface tui;
tui.TextBorder(HelpTitle, HelpInstruction);
//Interface tui;
//tui.TextBorder(HelpTitle, HelpInstruction);
}
bool EmptyPath(std::string path)
@ -118,7 +117,7 @@ int main(int argc, char* argv[]) {
i++;
}
if (arg == "-p" && i + 1 < argc)
if (arg == "-r" && i + 1 < argc)
{
path = argv[i + 1];
if (!cargo.Create(path, 0))
@ -128,6 +127,26 @@ int main(int argc, char* argv[]) {
i++;
}
if (arg == "-e" && i + 1 < argc)
{
path = argv[i + 1];
if (!cargo.Create(path, 2))
{
return 1;
}
i++;
}
if (arg == "-s" && i + 1 < argc)
{
path = argv[i + 1];
if (!cargo.Create(path, 3))
{
return 1;
}
i++;
}
if (arg == "-f" && i + 1 < argc)
{
path = argv[i + 1];