diff options
author | Nate Straz <nstraz@redhat.com> | 2006-09-19 15:19:27 +0000 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2008-09-23 09:37:46 -0400 |
commit | 553e877c6d5e5249371573fc91e66f446111c67f (patch) | |
tree | 415d29aee98a4d5b7e7b0ed8a09a2c659d4afa6b /qarsh.c | |
parent | ac7a3387793b333f519940046a6f8d295c9d0596 (diff) | |
download | qarsh-553e877c6d5e5249371573fc91e66f446111c67f.tar.gz qarsh-553e877c6d5e5249371573fc91e66f446111c67f.tar.xz qarsh-553e877c6d5e5249371573fc91e66f446111c67f.zip |
When no args were given, argv[0] would return NULL and the program
name in the usage output would show "(null)." qarsh isn't called anything
else so just hard code qarsh in the usage message.
Diffstat (limited to 'qarsh.c')
-rw-r--r-- | qarsh.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -38,9 +38,9 @@ int sigs_to_propogate[] = { SIGINT, SIGTERM, SIGHUP, SIGUSR1, SIGUSR2 }; sigset_t pselect_sigmask; void -usage(const char *pname) +usage() { - fprintf(stderr, "%s [options] [user[.group]@]hostname cmdline ...\n" + fprintf(stderr, "qarsh [options] [user[.group]@]hostname cmdline ...\n" "-l user Run cmdline using this user name.\n" "-g group Run cmdline using this group name.\n" "-p port Use this port to contact qarshd.\n" @@ -49,8 +49,7 @@ usage(const char *pname) " A value of 0 disables heartbeating.\n" " Default is value is 120.\n" " Env var QARSH_TIMEOUT can also be set.\n" - - ,pname); + ); return; } @@ -391,7 +390,7 @@ again: case '?': default: printf("Unknown option %c\n", (char)optopt); - usage(argv[0]); + usage(); exit(1); } } /* Some programs (rsync) put the hostname before some qarsh options @@ -412,7 +411,7 @@ again: } if (!host) { - usage(argv[0]); + usage(); exit(1); } @@ -439,7 +438,7 @@ again: } if ((args = copyargs(argv)) == NULL) { - usage(argv[0]); + usage(); exit(1); } |