make option -f not take arguments in the server

This commit is contained in:
marschap
2006-09-19 08:26:22 +00:00
parent a65d5645f9
commit 77dd01d3ed
4 changed files with 11 additions and 18 deletions
+7 -6
View File
@@ -5,10 +5,9 @@ LCDd - LCDproc server daemon
.SH SYNOPSIS
.B LCDd
[\fB\-h\fP]
[\fB\-hf\fP]
[\fB\-c\fP \fIconfig\fP]
[\fB\-d\fP \fIdriver\fP]
[\fB\-f\fP \fIbool\fP]
[\fB\-i\fP \fIbool\fP]
[\fB\-a\fP \fIaddr\fP]
[\fB\-p\fP \fIport\fP]
@@ -44,9 +43,11 @@ Use a configuration file other than @SYSCONFDIR@/LCDd.conf
Specify a driver to use (output only to first), overriding
the \fBDriver\fP parameter in the config file's \fB[Server]\fP section.
.TP
.B \-f \fIbool\fp
Tell whether to run in the foreground (\fI1\fP) or background (\fI0\fP),
overriding the \fBForeground\fP parameter in the config file's \fB[Server]\fP section.
.B \-f
Run LCDd in foreground, overriding the \fBForeground\fP parameter
in the config file's \fB[Server]\fP section.
The default, if not in the config file or without a config file, is to
daemonize \fBLCDd\fP as it is intended to operate in the background.
.TP
.B \-i \fIbool\fP
Tell whether the to enable (\fI1\fP) or disable (\fI0\fP) showing the LCDproc
@@ -437,7 +438,7 @@ If LCDd seems not to work as expected, try to run it with reporting level set to
reporting to stderr and running it in the foreground.
This can be achieved without changes to the config file by using the following command line:
.RS
.I LCDd -f 1 -r 5 -s 0
.I LCDd -f -r 5 -s 0
.RE
.SH FILES
+1 -3
View File
@@ -5,13 +5,11 @@ lcdproc - system status information client
.SH SYNOPSIS
.B lcdproc
[\fB\-hfv\fP]
[\fB\-c\fP \fIconfig\fP]
[\fB\-s\fP \fIhost\fP]
[\fB\-p\fP \fIport\fP]
[\fB\-e\fP \fIdelay\fP]
[\fB\-f\fP]
[\fB\-h\fP]
[\fB\-v\fP]
[\fIscreen\fP ...]
.SH DESCRIPTION
+1 -1
View File
@@ -28,7 +28,7 @@ test -x ${LCDd} || exit 0
case "$1" in
start)
printf "Starting $DESC:"
start-stop-daemon --start --quiet --background --exec ${LCDd} -- -s -f -c ${configfile}
start-stop-daemon --start --quiet --background --exec ${LCDd} -- -c ${configfile}
printf " LCDd"
printf ".\n"
;;
+2 -8
View File
@@ -301,7 +301,7 @@ process_command_line(int argc, char **argv)
/* Analyze options here.. (please try to keep list of options the
* same everywhere) */
while ((c = getopt(argc, argv, "hc:d:f:a:p:u:w:s:r:i:" )) > 0) {
while ((c = getopt(argc, argv, "hc:d:fa:p:u:w:s:r:i:" )) > 0) {
switch(c) {
case 'h':
help = 1; /* Continue to process the other
@@ -328,13 +328,7 @@ process_command_line(int argc, char **argv)
}
break;
case 'f':
b = interpret_boolean_arg( optarg );
if( b == -1 ) {
report( RPT_ERR, "Not a boolean value: '%s'", optarg );
e = -1;
} else {
foreground_mode = b;
}
foreground_mode = 1;
break;
case 'a':
strncpy(bind_addr, optarg, sizeof(bind_addr));