From: Roy Marples Date: Fri, 18 Jul 2008 09:17:52 +0000 (+0000) Subject: Move -X to -B and give it a long option. This now complements the --background option. X-Git-Tag: v4.0.2~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0883583f6b71c9bf5d30e2724436812efab3b83b;p=thirdparty%2Fdhcpcd.git Move -X to -B and give it a long option. This now complements the --background option. --- diff --git a/dhcpcd.8.in b/dhcpcd.8.in index f5565b35..7316d5ac 100644 --- a/dhcpcd.8.in +++ b/dhcpcd.8.in @@ -29,7 +29,7 @@ .Nd an RFC 2131 compliant DHCP client .Sh SYNOPSIS .Nm -.Op Fl bdknpqADEGKLSTVX +.Op Fl bdknpqABDEGKLSTV .Op Fl c , -script Ar script .Op Fl f , -config Ar file .Op Fl h , -hostname Ar hostname @@ -319,6 +319,10 @@ The messages are still logged though. .It Fl A , -noarp Don't request or claim the address by ARP. This also disables IPv4LL. +.It Fl B , -nobackground +Don't run in the background when we acquire a lease. +This is mainly useful for running under the control of another process, such +as a debugger or a network manager. .It Fl C , -nohook Ar script Don't run this hook script. Matches full name, or prefixed with 2 numbers optionally ending with @@ -347,10 +351,6 @@ files. .It Fl V, -variables Display a list of option codes and the associated variable for use in .Xr dhcpcd-run-hooks 8 . -.It Fl X , -nodaemonise -Don't daemonise when we acquire a lease. -This is mainly useful for running under the control of another process, such -as a debugger or a network manager. .El .Sh NOTES .Nm diff --git a/dhcpcd.c b/dhcpcd.c index 1ca50c64..dfa435a1 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -52,7 +52,7 @@ const char copyright[] = "Copyright (c) 2006-2008 Roy Marples"; /* Don't set any optional arguments here so we retain POSIX * compatibility with getopt */ -#define OPTS "bc:df:h:i:kl:m:no:pqr:s:t:u:v:xAC:DEF:GI:KLO:TVX" +#define OPTS "bc:df:h:i:kl:m:no:pqr:s:t:u:v:xABC:DEF:GI:KLO:TV" static int doversion = 0; static int dohelp = 0; @@ -77,6 +77,7 @@ static const struct option longopts[] = { {"vendor", required_argument, NULL, 'v'}, {"exit", no_argument, NULL, 'x'}, {"noarp", no_argument, NULL, 'A'}, + {"nobackground",no_argument, NULL, 'B'}, {"nohook", required_argument, NULL, 'C'}, {"duid", no_argument, NULL, 'D'}, {"lastlease", no_argument, NULL, 'E'}, @@ -485,6 +486,9 @@ parse_option(int opt, char *oarg, struct options *options) /* IPv4LL requires ARP */ options->options &= ~DHCPCD_IPV4LL; break; + case 'B': + options->options &= ~DHCPCD_DAEMONISE; + break; case 'C': /* Commas to spaces for shell */ while ((p = strchr(oarg, ','))) @@ -557,9 +561,6 @@ parse_option(int opt, char *oarg, struct options *options) return -1; } break; - case 'X': - options->options &= ~DHCPCD_DAEMONISE; - break; default: return 0; }