diff options
author | Nicholas Tay <nick@windblume.net> | 2022-01-13 23:45:15 +1100 |
---|---|---|
committer | Nicholas Tay <nick@windblume.net> | 2022-01-13 23:45:15 +1100 |
commit | fb4cc1accdf41204978beef6f7c9e2bdf4acbb54 (patch) | |
tree | e0264e1adf59d6c8581ff5e845f7fe75d11e49a1 /passgen.c | |
parent | 3ab3302c51960212b3ed51d92da140e8f93105ce (diff) | |
download | passgen-fb4cc1accdf41204978beef6f7c9e2bdf4acbb54.tar.gz passgen-fb4cc1accdf41204978beef6f7c9e2bdf4acbb54.tar.bz2 passgen-fb4cc1accdf41204978beef6f7c9e2bdf4acbb54.zip |
Add help option
Diffstat (limited to 'passgen.c')
-rw-r--r-- | passgen.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -121,6 +121,19 @@ int main(int argc, char *argv[]) char *password = password_buf; if (argc == 2) { + if (strcmp(argv[1], "--help") == 0) { + printf("\ +passgen - a small, customisable password generator\n\ +Usage: %s\n\ + %s <grammar>\n\ + %s <#triplets ('Cvc')> <#symbols> <#numbers>\n\ +Hints:\n\ + - No arguments generates with the default grammar.\n\ + - If three numbers are provided, a password will be generated in the 'standard form', <triplets><symbols><numbers>.\n\ +Compile-time options:\n\ + - Default grammar: %s\n", argv[0], argv[0], argv[0], grammar_buf); + return 0; + } /* Take first argument as the grammar */ grammar = argv[1]; grammar_size = strlen(grammar); |