]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Allow --fqdn to work without an option, defaulting to both.
authorRoy Marples <roy@marples.name>
Tue, 4 Mar 2008 11:05:23 +0000 (11:05 +0000)
committerRoy Marples <roy@marples.name>
Tue, 4 Mar 2008 11:05:23 +0000 (11:05 +0000)
dhcpcd.c

index e1018472611720b415dfaf39fa9ee49ccf4ed89c..23379d5ce6a26ebde9f92bb498e5e7be185dc075 100644 (file)
--- 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)