changeset 375:e4f067ffaa05 draft

Allow --fqdn to work without an option, defaulting to both.
author Roy Marples <roy@marples.name>
date Tue, 04 Mar 2008 11:05:23 +0000
parents b3577bb9b0c6
children f9ca87dc4b56
files dhcpcd.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dhcpcd.c	Mon Feb 25 08:28:19 2008 +0000
+++ b/dhcpcd.c	Tue Mar 04 11:05:23 2008 +0000
@@ -71,7 +71,7 @@
 	{"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 @@
 				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)