ovsdb-server: Improve error message when database file argument is missing.
authorBen Pfaff <blp@nicira.com>
Tue, 15 Dec 2009 21:10:16 +0000 (13:10 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 15 Dec 2009 21:11:57 +0000 (13:11 -0800)
ovsdb/ovsdb-server.c

index d3a332e..3bd5bc5 100644 (file)
@@ -225,9 +225,11 @@ parse_options(int argc, char *argv[], char **file_namep,
     argc -= optind;
     argv += optind;
 
-    if (argc != 1) {
+    if (argc > 1) {
         ovs_fatal(0, "database file is only non-option argument; "
                 "use --help for usage");
+    } else if (argc < 1) {
+        ovs_fatal(0, "missing database file argument; use --help for usage");
     }
 
     *file_namep = argv[0];