Forgot to remove old usage() function
authorJelmer Vernooij <jelmer@samba.org>
Thu, 29 Aug 2002 12:44:37 +0000 (12:44 +0000)
committerJelmer Vernooij <jelmer@samba.org>
Thu, 29 Aug 2002 12:44:37 +0000 (12:44 +0000)
(This used to be commit 4631e1fd1039c7eed58d3738bd7310219acc9000)

source3/rpcclient/rpcclient.c

index 470ff7c1e326fae30c3cd14657b3c9434596f755..5f15c57577489c139c9e42b19de42a12c1fc41fd 100644 (file)
@@ -573,23 +573,6 @@ static NTSTATUS process_cmd(struct cli_state *cli, char *cmd)
 }
 
 
-/* Print usage information */
-static void usage(void)
-{
-       printf("Usage: rpcclient [options] server\n");
-
-       printf("\t-c or --command \"command string\"   Execute semicolon separated cmds\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("\t-N or --nopass                     Don't ask for a password\n");
-       printf("\t-s or --conf configfile            Specify an alternative config file\n");
-       printf("\t-U or --user username              Set the network username\n");
-       printf("\t-W or --workgroup domain           Set the domain name for user account\n");
-       printf("\t-I or --dest-ip ip                 Specify destination IP address\n");
-       printf("\n");
-}
-
 /* Main function */
 
  int main(int argc, char *argv[])
@@ -641,14 +624,14 @@ static void usage(void)
 
        /* Parse options */
 
+       pc = poptGetContext("rpcclient", argc, (const char **) argv,
+                           long_options, 0);
+
        if (argc == 1) {
-               usage();
+               poptPrintHelp(pc, stderr, 0);
                return 0;
        }
        
-       pc = poptGetContext("rpcclient", argc, (const char **) argv,
-                           long_options, 0);
-       
        while((opt = poptGetNextOpt(pc)) != -1) {
                switch (opt) {
                case 'A':
@@ -692,11 +675,6 @@ static void usage(void)
                case 'W':
                        pstrcpy(domain, opt_domain);
                        break;
-                       
-               case 'h':
-               default:
-                       usage();
-                       exit(1);
                }
        }
 
@@ -706,7 +684,7 @@ static void usage(void)
        server = poptGetArg(pc);
        
        if (!server || poptGetArg(pc)) {
-               usage();
+               poptPrintHelp(pc, stderr, 0);
                return 1;
        }