diff options
author | Mike Frysinger <vapier@gentoo.org> | 2007-04-17 12:44:32 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2007-04-17 12:44:32 +0000 |
commit | 9d50d4cb258ad0e63ca85467817bccf9765d8326 (patch) | |
tree | 437f66d62899212562a74879c52bfd842bacfe2b /src/mountinfo.c | |
parent | f5e65274f0f150d6db9f53f87e87eb6d984f8e94 (diff) |
start unifying help handling
Diffstat (limited to 'src/mountinfo.c')
-rw-r--r-- | src/mountinfo.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/src/mountinfo.c b/src/mountinfo.c index 85d4ecc3..4699fcd5 100644 --- a/src/mountinfo.c +++ b/src/mountinfo.c @@ -5,6 +5,8 @@ Copyright 2007 Gentoo Foundation */ +#define APPLET "mountinfo" + #include <sys/types.h> #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #include <sys/param.h> @@ -139,16 +141,7 @@ static struct option longopts[] = { { "help", 0, NULL, 'h'}, { NULL, 0, NULL, 0} }; - -static void usage (int exit_status) -{ - int i; - printf ("Usage: mountinfo [options]\n\n"); - printf ("Options:\n"); - for (i = 0; longopts[i].name; ++i) - printf (" -%c, --%s\n", longopts[i].val, longopts[i].name); - exit (exit_status); -} +#include "_usage.c" int main (int argc, char **argv) { @@ -219,11 +212,7 @@ int main (int argc, char **argv) reverse = true; break; - case 'h': - usage (EXIT_SUCCESS); - - default: - usage (EXIT_FAILURE); + case_RC_COMMON_GETOPT } while (optind < argc) { |