ostree: do not print the usage on each G_IO_ERROR_NOT_SUPPORTED
authorGiuseppe Scrivano <gscrivan@redhat.com>
Fri, 6 Nov 2015 11:06:26 +0000 (12:06 +0100)
committerGiuseppe Scrivano <gscrivan@redhat.com>
Mon, 16 Nov 2015 10:07:55 +0000 (11:07 +0100)
It may have a different meaning, and the usage screen is not helpful.

Print the usage screen only when the command is not found.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
src/ostree/main.c
src/ostree/ot-main.c

index 8842bf346c703412889bfe044e83d0139b63c52c..99d7d91601ef3e885454596a26606d75eeeaaf70 100644 (file)
@@ -75,8 +75,6 @@ main (int    argc,
   g_set_prgname (argv[0]);
 
   ret = ostree_run (argc, argv, commands, &error);
-  if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED))
-    ostree_usage (commands, TRUE);
 
   if (error != NULL)
     {
index 44e1bd49e5045c0bd0e88f642771459c6878f87b..5b54af4ceaff83e6068eaa8ea069a62df715a181 100644 (file)
@@ -190,6 +190,7 @@ ostree_run (int    argc,
             {
               g_set_error (&error, G_IO_ERROR, G_IO_ERROR_FAILED,
                            "Unknown command '%s'", command_name);
+              ostree_usage (commands, TRUE);
             }
         }