diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-08-26 06:15:42 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@redhat.com> | 2009-08-26 06:15:42 -0400 |
commit | 3544e685ade5b331e473c8680d42a748d9389125 (patch) | |
tree | 38b27afc28d29c4b6b0ea9adc943162c21176c53 | |
parent | 1a97bd915dfe90b40ec03617af3d8d25483af9c9 (diff) | |
download | samba-3544e685ade5b331e473c8680d42a748d9389125.tar.gz samba-3544e685ade5b331e473c8680d42a748d9389125.tar.bz2 samba-3544e685ade5b331e473c8680d42a748d9389125.zip |
cifs.upcall: switch to getopt_long
...to allow long option names.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
-rw-r--r-- | client/cifs.upcall.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/cifs.upcall.c b/client/cifs.upcall.c index c89df9cf63..f06d563959 100644 --- a/client/cifs.upcall.c +++ b/client/cifs.upcall.c @@ -27,6 +27,7 @@ create dns_resolver * * /usr/local/sbin/cifs.upcall %k #include "includes.h" #include <keyutils.h> +#include <getopt.h> #include "cifs_spnego.h" @@ -357,6 +358,11 @@ usage(void) fprintf(stderr, "Usage: %s [-v] key_serial\n", prog); } +const struct option long_options[] = { + { "version", 0, NULL, 'v' }, + { NULL, 0, NULL, 0 } +}; + int main(const int argc, char *const argv[]) { struct cifs_spnego_msg *keydata = NULL; @@ -374,7 +380,7 @@ int main(const int argc, char *const argv[]) openlog(prog, 0, LOG_DAEMON); - while ((c = getopt(argc, argv, "cv")) != -1) { + while ((c = getopt_long(argc, argv, "cv", long_options, NULL)) != -1) { switch (c) { case 'c': /* legacy option -- skip it */ |