chiark / gitweb /
allow hostname fqdn as non-option argument
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Tue, 20 Apr 2010 20:16:23 +0000 (21:16 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Tue, 20 Apr 2010 20:16:23 +0000 (21:16 +0100)
backends/innduct.c

index 89e15b63f7e2929d18925d7e0df3a13d111b1e89..27fba9005c0f6e795b2aa214611c53f166f38db1 100644 (file)
@@ -2181,9 +2181,15 @@ int main(int argc, char **argv) {
   }
 
   if (!arg) badusage("need site name argument");
-  if (*++argv) badusage("too many non-option arguments");
   sitename= arg;
 
+  if ((arg= *++argv)) {
+    if (remote_host) badusage("must not specify -h and also host as argument");
+    remote_host= arg;
+  }
+
+  if (*++argv) badusage("too many non-option arguments");
+
   if (nocheck_thresh_pct < 0 || nocheck_thresh_pct > 100)
     badusage("nocheck threshold percentage must be between 0..100");
   nocheck_thresh= nocheck_thresh_pct * 0.01;