cmd_parser: Return error if the specified pkglist file doesn't exists
authorTomas Mlcoch <tmlcoch@redhat.com>
Mon, 19 May 2014 12:55:13 +0000 (14:55 +0200)
committerTomas Mlcoch <tmlcoch@redhat.com>
Mon, 19 May 2014 12:55:46 +0000 (14:55 +0200)
src/cmd_parser.c

index 42999c8..1ed15be 100644 (file)
@@ -346,7 +346,9 @@ check_arguments(struct CmdOptions *options,
     // Process pkglist file
     if (options->pkglist) {
         if (!g_file_test(options->pkglist, G_FILE_TEST_IS_REGULAR)) {
-            g_warning("pkglist file \"%s\" doesn't exists", options->pkglist);
+            g_set_error(err, CR_CMD_ERROR, CRE_BADARG,
+                        "pkglist file \"%s\" doesn't exists", options->pkglist);
+            return FALSE;
         } else {
             char *content = NULL;
             GError *tmp_err = NULL;