logger: Replace -h with -?, -h is reserved in POSIX for remote host
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
4382136d18
commit
d0360f47ed
11
src/logger.c
11
src/logger.c
@ -198,11 +198,11 @@ static int parse_prio(char *arg, int *f, int *l)
|
|||||||
|
|
||||||
static int usage(int code)
|
static int usage(int code)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Usage: logger [OPTIONS] [MESSAGE]\n"
|
printf("Usage: logger [OPTIONS] [MESSAGE]\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Write MESSAGE (or stdin) to syslog, or file (with logrotate)\n"
|
"Write MESSAGE (or stdin) to syslog, or file (with logrotate)\n"
|
||||||
"\n"
|
"\n"
|
||||||
" -h This help text\n"
|
" -? This help text\n"
|
||||||
" -p PRIO Priority (numeric or facility.level pair)\n"
|
" -p PRIO Priority (numeric or facility.level pair)\n"
|
||||||
" -t TAG Log using the specified tag (defaults to user name)\n"
|
" -t TAG Log using the specified tag (defaults to user name)\n"
|
||||||
" -s Log to stderr as well as the system log\n"
|
" -s Log to stderr as well as the system log\n"
|
||||||
@ -228,15 +228,12 @@ int main(int argc, char *argv[])
|
|||||||
char *ident = NULL, *logfile = NULL;
|
char *ident = NULL, *logfile = NULL;
|
||||||
char buf[512] = "";
|
char buf[512] = "";
|
||||||
|
|
||||||
while ((c = getopt(argc, argv, "f:hn:p:r:st:v")) != EOF) {
|
while ((c = getopt(argc, argv, "?f:n:p:r:st:v")) != EOF) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'f':
|
case 'f':
|
||||||
logfile = optarg;
|
logfile = optarg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
|
||||||
return usage(0);
|
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
size = atoi(optarg);
|
size = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
@ -263,7 +260,7 @@ int main(int argc, char *argv[])
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return usage(1);
|
return usage(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user