From 6fe4e7f082beca523e237db60807e2d3535fee45 Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Tue, 21 Jun 2011 17:12:21 +0200 Subject: automatic commit for pwgen-2.01 --- pwgen.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'pwgen.c') diff --git a/pwgen.c b/pwgen.c index 84a8284..590bacf 100644 --- a/pwgen.c +++ b/pwgen.c @@ -44,6 +44,31 @@ struct option pwgen_options[] = { }; #endif +const char *usage_msg = +"Usage: pwgen [ OPTIONS ] [ pw_length ] [ num_pw ]\n\n" +"Options supported by pwgen:\n" +" -c or -capitalize\n" +"\tInclude at least one capital letter in the password\n" +" -n or --numerals\n" +"\tInclude at least one number in the password\n" +" -s or --secure\n" +"\tGenerate completely random passwords\n" +" -h or --help\n" +"\tPrint a help message\n" +" --no-numerals, --no-capitalize\n" +"\tDon't include a number or capital letter in the password\n" +" -C\n\tPrint the generated passwords in columns\n" +" -1\n\tDon't print the generated passwords in columns\n" +; + +void usage(void) +{ + fprintf(stderr, usage_msg); + + exit(1); +} + + int main(int argc, char **argv) { int term_width = 80; @@ -93,6 +118,10 @@ int main(int argc, char **argv) case '1': do_columns = 0; break; + case 'h': + case '?': + usage(); + break; } } if (optind < argc) { -- cgit v1.2.3