diff options
Diffstat (limited to 'progs/getcap.c')
-rw-r--r-- | progs/getcap.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/progs/getcap.c b/progs/getcap.c index 225207f..208bd6a 100644 --- a/progs/getcap.c +++ b/progs/getcap.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997,2007 Andrew G. Morgan <morgan@kernel.org> + * Copyright (c) 1997,2007 Andrew G. Morgan <morgan@kernel.org> * * This displays the capabilities of a given file. */ @@ -23,14 +23,14 @@ static int verbose = 0; static int recursive = 0; static int namespace = 0; -static void usage(void) +static void usage(int code) { fprintf(stderr, - "usage: getcap [-v] [-r] [-h] [-n] <filename> [<filename> ...]\n" - "\n" - "\tdisplays the capabilities on the queried file(s).\n" + "usage: getcap [-h] [-l] [-n] [-r] [-v] <filename> [<filename> ...]\n" + "\n" + "\tdisplays the capabilities on the queried file(s).\n" ); - exit(1); + exit(code); } static int do_getcap(const char *fname, const struct stat *stbuf, @@ -82,7 +82,7 @@ int main(int argc, char **argv) { int i, c; - while ((c = getopt(argc, argv, "rvhn")) > 0) { + while ((c = getopt(argc, argv, "rvhnl")) > 0) { switch(c) { case 'r': recursive = 1; @@ -93,13 +93,20 @@ int main(int argc, char **argv) case 'n': namespace = 1; break; + case 'h': + usage(0); + case 'l': + printf("%s has a you choose license: BSD 3-clause or GPL2\n" + "Copyright (c) 1997,2007 Andrew G. Morgan" + " <morgan@kernel.org>\n", argv[0]); + exit(0); default: - usage(); + usage(1); } } if (!argv[optind]) - usage(); + usage(1); for (i=optind; argv[i] != NULL; i++) { struct stat stbuf; |