From: Roy Marples Date: Tue, 4 Mar 2008 11:05:23 +0000 (+0000) Subject: Allow --fqdn to work without an option, defaulting to both. X-Git-Tag: v4.0.2~547 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7fdefd260d688c053b948ae7b28566930a3afb1;p=thirdparty%2Fdhcpcd.git Allow --fqdn to work without an option, defaulting to both. --- diff --git a/dhcpcd.c b/dhcpcd.c index e1018472..23379d5c 100644 --- a/dhcpcd.c +++ b/dhcpcd.c @@ -71,7 +71,7 @@ static const struct option longopts[] = { {"userclass", required_argument, NULL, 'u'}, {"exit", no_argument, NULL, 'x'}, {"lastlease", no_argument, NULL, 'E'}, - {"fqdn", required_argument, NULL, 'F'}, + {"fqdn", optional_argument, NULL, 'F'}, {"nogateway", no_argument, NULL, 'G'}, {"sethostname", no_argument, NULL, 'H'}, {"clientid", optional_argument, NULL, 'I'}, @@ -348,6 +348,10 @@ int main(int argc, char **argv) options->dolastlease = true; break; case 'F': + if (! optarg) { + options->fqdn = FQDN_BOTH; + break; + } if (strncmp (optarg, "none", strlen (optarg)) == 0) options->fqdn = FQDN_NONE; else if (strncmp (optarg, "ptr", strlen (optarg)) == 0)