add print file size

This commit is contained in:
nikola
2024-06-20 02:32:19 +02:00
parent 31e9935511
commit 1cbf1628a3
3 changed files with 15 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ void print_args()
printf(" -l list all labels\n");
printf(" -p print all passwords\n");
printf(" -c change master password\n");
printf(" -z print size of file\n");
printf(" -f <folder path> select save folder\n");
}
@@ -58,6 +59,8 @@ Arg get_args(int argc, char **argv, char **label)
return Arg::Print_all_p;
case 'c':
return Arg::Change;
case 'z':
return Arg::Size;
}
if (argc != 3)
@@ -347,4 +350,9 @@ void arg_file(Buffer &decrypted_buffer, Buffer &encrypted_buffer, const char *la
crypto.encrypt(&decrypted_buffer, &encrypted_buffer);
encrypted_buffer.save_to_file(save.string());
}
void arg_size(Buffer &encrypted_buffer)
{
printf("File size is: %ldB\n", encrypted_buffer.taken);
}