diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2002-08-29 12:05:30 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2002-08-29 12:05:30 +0000 |
commit | 4d64593834eb8c5074a0d7725614b44082ea8eb0 (patch) | |
tree | 96933d39f2b1c405d9faee42d486c4a7f777f051 /source3/torture/vfstest.c | |
parent | 88f8ccd2b25151004dfd9c06a98ddc87066428df (diff) | |
download | samba-4d64593834eb8c5074a0d7725614b44082ea8eb0.tar.gz samba-4d64593834eb8c5074a0d7725614b44082ea8eb0.tar.bz2 samba-4d64593834eb8c5074a0d7725614b44082ea8eb0.zip |
Use popt for printing --help message
(This used to be commit 355d28d9eae2fd4b94bb591c5c51cad2fab9d2fd)
Diffstat (limited to 'source3/torture/vfstest.c')
-rw-r--r-- | source3/torture/vfstest.c | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c index 2186e28cdf..824e8108bf 100644 --- a/source3/torture/vfstest.c +++ b/source3/torture/vfstest.c @@ -470,19 +470,6 @@ BOOL reload_services(BOOL test) return (ret); } -/* Print usage information */ -static void usage(void) -{ - printf("Usage: vfstest [options]\n"); - - printf("\t-c or --command \"command string\" execute semicolon separated cmds\n"); - printf("\t-f or --file filename execute a set of operations as described in the file\n"); - printf("\t-d or --debug debuglevel set the debuglevel\n"); - printf("\t-l or --logfile logfile logfile to use instead of stdout\n"); - printf("\t-h or --help Print this help message.\n"); - printf("\n"); -} - /* Main function */ int main(int argc, char *argv[]) @@ -503,12 +490,11 @@ int main(int argc, char *argv[]) a fixed location or certain compilers complain */ poptContext pc; struct poptOption long_options[] = { - {"file", 'f', POPT_ARG_STRING, &filename}, - {"debug", 'd', POPT_ARG_INT, &opt_debuglevel, 'd'}, - {"debuglevel", 'd', POPT_ARG_INT, &opt_debuglevel, 'd'}, - {"command", 'c', POPT_ARG_STRING, &cmdstr}, - {"logfile", 'l', POPT_ARG_STRING, &opt_logfile, 'l'}, - {"help", 'h', POPT_ARG_NONE, 0, 'h'}, + POPT_AUTOHELP + {"file", 'f', POPT_ARG_STRING, &filename, 0, }, + {"command", 'c', POPT_ARG_STRING, &cmdstr, 0, "Execute specified list of commands" }, + {"logfile", 'l', POPT_ARG_STRING, &opt_logfile, 'l', 0, "Write output to specified logfile" }, + { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debug }, { 0, 0, 0, 0} }; @@ -533,11 +519,6 @@ int main(int argc, char *argv[]) case 'd': DEBUGLEVEL = opt_debuglevel; break; - - case 'h': - default: - usage(); - exit(1); } } |