Added documentation and command help messages to decryption tools.

This commit is contained in:
Heiko Reese
2021-09-12 02:36:21 +02:00
parent e26daf675b
commit 32e060d88d
4 changed files with 80 additions and 5 deletions

View File

@ -64,6 +64,7 @@ int main(int argc, char *argv[]) {
}
// define arguments
const char *shortargs = "s:p:S:P:f:nh";
static struct option long_options[] = {
{"secret-key", required_argument, NULL, 's'},
{"public-key", required_argument, NULL, 'p'},
@ -71,6 +72,7 @@ int main(int argc, char *argv[]) {
{"public-key-file", required_argument, NULL, 'P'},
{"infile", required_argument, NULL, 'f'},
{"no-newline", required_argument, NULL, 'n'},
{"help", no_argument, NULL, 'h'},
{0, 0, 0, 0}
};
@ -96,7 +98,7 @@ int main(int argc, char *argv[]) {
// parse arguments
int long_index = 0;
while ((opt = getopt_long(argc, argv, "s:p:S:P:f:n",
while ((opt = getopt_long(argc, argv, shortargs,
long_options, &long_index)) != -1) {
switch (opt) {
case 's':
@ -128,6 +130,10 @@ int main(int argc, char *argv[]) {
case 'n':
add_newline = false;
break;
case 'h':
print_usage(prog_basename);
exit(EXIT_SUCCESS);
break;
}
}