aboutsummaryrefslogtreecommitdiff
path: root/passgen.c
diff options
context:
space:
mode:
Diffstat (limited to 'passgen.c')
-rw-r--r--passgen.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/passgen.c b/passgen.c
index e759766..5039fe4 100644
--- a/passgen.c
+++ b/passgen.c
@@ -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);