Fix moonshot-webp usage output (LP #1240007)
authorKevin Wasserman <kevin.wasserman@painless-security.com>
Tue, 15 Oct 2013 23:33:50 +0000 (19:33 -0400)
committerKevin Wasserman <kevin.wasserman@painless-security.com>
Tue, 15 Oct 2013 23:33:50 +0000 (19:33 -0400)
use stdout.printf() instead of error(); exit immediately.

src/moonshot-webp-parser.vala

index aa89660..a6172e1 100644 (file)
@@ -29,13 +29,15 @@ namespace WebProvisioning
     }
     if (bad_switch || (arg_index != args.length - 1))
     {
-      error ("Usage %s [-f] WEB_PROVISIONING_FILE\n -f: add identities to flat file store", args[0]);
+      stdout.printf (_("Usage %s [-f] WEB_PROVISIONING_FILE\n -f: add identities to flat file store.\n"), args[0]);
+      return -1;
     }
     string webp_file = args[arg_index];
     
     if (!FileUtils.test (webp_file, FileTest.EXISTS | FileTest.IS_REGULAR))
     {
-      error ("%s does not exist", webp_file);
+      stdout.printf (_("%s does not exist\n"), webp_file);
+      return -1;
     }
     
     var webp = new Parser (webp_file);