Skip to content

Commit

Permalink
Added -h help arg
Browse files Browse the repository at this point in the history
  • Loading branch information
edenhill committed Dec 17, 2016
1 parent 0c6233d commit ef11149
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ echo ""
echo "Success! kafkacat is now built"
echo ""

./kafkacat -V
./kafkacat -h
7 changes: 6 additions & 1 deletion kafkacat.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,7 @@ static void __attribute__((noreturn)) usage (const char *argv0, int exitcode,
" -q Be quiet (verbosity set to 0)\n"
" -v Increase verbosity\n"
" -V Print version\n"
" -h Print usage help\n"
"\n"
"Producer options:\n"
" -z snappy|gzip Message compression. Default: none\n"
Expand Down Expand Up @@ -991,7 +992,7 @@ static void argparse (int argc, char **argv) {
char tmp_fmt[64];

while ((opt = getopt(argc, argv,
"PCG:Lt:p:b:z:o:eD:K:Od:qvX:c:Tuf:ZlV"
"PCG:Lt:p:b:z:o:eD:K:Od:qvX:c:Tuf:ZlVh"
#if ENABLE_JSON
"J"
#endif
Expand Down Expand Up @@ -1153,6 +1154,10 @@ static void argparse (int argc, char **argv) {
usage(argv[0], 0, NULL, 1);
break;

case 'h':
usage(argv[0], 0, NULL, 0);
break;

default:
usage(argv[0], 1, "unknown argument", 0);
break;
Expand Down

0 comments on commit ef11149

Please sign in to comment.