Properly display popt errors. Also fix debug to be -d for consistency with other...
authorJim McDonough <jmcd@samba.org>
Tue, 21 Jan 2003 14:08:33 +0000 (14:08 +0000)
committerJim McDonough <jmcd@samba.org>
Tue, 21 Jan 2003 14:08:33 +0000 (14:08 +0000)
source/utils/net.c

index 5c1156abf9563aa69bc55b95ba2ce2b293840cfa..33195375f598efa709f1e9bf361e08b9a4fa19e5 100644 (file)
@@ -536,7 +536,7 @@ static struct functable net_func[] = {
                {"force",       'f', POPT_ARG_NONE,   &opt_force},
                {"timeout",     't', POPT_ARG_INT,    &opt_timeout},
                {"machine-pass",'P', POPT_ARG_NONE,   &opt_machine_pass},
-               {"debuglevel",  'D', POPT_ARG_STRING, &debuglevel},
+               {"debuglevel",  'd', POPT_ARG_STRING, &debuglevel},
                { 0, 0, 0, 0}
        };
 
@@ -570,7 +570,8 @@ static struct functable net_func[] = {
                        }
                        break;
                default:
-                       d_printf("\nInvalid option %c (%d)\n", (char)opt, opt);
+                       d_printf("\nInvalid option %s: %s\n", 
+                                poptBadOption(pc, 0), poptStrerror(opt));
                        net_help(argc, argv);
                        exit(1);
                }