Zcalanie ręczne. Jak git nie chce po dobroci to będzie siłą
This commit is contained in:
parent
690e5278c5
commit
3bf98ba472
22 changed files with 790 additions and 457 deletions
55
voidcmd.cpp
55
voidcmd.cpp
|
|
@ -40,34 +40,35 @@ 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"
|
||||
" -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 AES256 \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)
|
||||
static bool EmptyPath(std::string path)
|
||||
{
|
||||
if (path == "")
|
||||
{
|
||||
|
|
@ -109,17 +110,37 @@ int main(int argc, char* argv[]) {
|
|||
|
||||
if (!EmptyPath(path)) { return 1; }
|
||||
|
||||
if (!cargo.Create(path, true, false))
|
||||
if (!cargo.Create(path, 1))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (arg == "-p" && i + 1 < argc)
|
||||
if (arg == "-r" && i + 1 < argc)
|
||||
{
|
||||
path = argv[i + 1];
|
||||
if (!cargo.Create(path, false, false))
|
||||
if (!cargo.Create(path, 0))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
|
@ -130,7 +151,7 @@ int main(int argc, char* argv[]) {
|
|||
{
|
||||
path = argv[i + 1];
|
||||
if (!EmptyPath(path)) { return 1; }
|
||||
if (!cargo.Create(path, false, true))
|
||||
if (!cargo.Create(path, -1))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue