check given directories in split mode
authorFrank Schreiner <schreiner@suse.de>
Mon, 4 Apr 2016 20:41:32 +0000 (20:41 +0000)
committerFrank Schreiner <schreiner@suse.de>
Mon, 4 Apr 2016 20:41:32 +0000 (20:41 +0000)
src/createrepo_c.c

index 87d3e56e455631025e61316ac77261f19ae37f09..f86692cd8178c0f36f7048f4381dfbafb2b0303b 100644 (file)
@@ -346,7 +346,15 @@ main(int argc, char **argv)
         exit(EXIT_SUCCESS);
     }
 
-    if ( ! cmd_options->split ) {
+    if ( cmd_options->split ) {
+        if (argc < 2) {
+            g_printerr("Must specify at least one directory to index.\n");
+            g_printerr("Usage: %s [options] <directory_to_index> [directory_to_index] ...\n\n",
+                     cr_get_filename(argv[0]));
+            free_options(cmd_options);
+            exit(EXIT_FAILURE);
+        }
+    } else {
         if (argc != 2) {
             // No mandatory arguments
             g_printerr("Must specify exactly one directory to index.\n");