From: Kevin Wasserman Date: Tue, 15 Oct 2013 22:37:10 +0000 (-0400) Subject: Parse options (including --help) in headless mode (LP #1235662) X-Git-Tag: 0.7.1~50 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot-ui.git;a=commitdiff_plain;h=a42027adaff9f562c1d9f21e8c65ba18a8a10870 Parse options (including --help) in headless mode (LP #1235662) --- diff --git a/src/moonshot-identity-manager-app.vala b/src/moonshot-identity-manager-app.vala index 7e7878c..c8ad666 100644 --- a/src/moonshot-identity-manager-app.vala +++ b/src/moonshot-identity-manager-app.vala @@ -332,6 +332,16 @@ public static int main(string[] args){ #endif if (headless) { + try { + var opt_context = new OptionContext(null); + opt_context.set_help_enabled (true); + opt_context.add_main_entries (options, null); + opt_context.parse(ref args); + } catch (OptionError e) { + stdout.printf(_("error: %s\n"),e.message); + stdout.printf(_("Run '%s --help' to see a full list of available options\n"), args[0]); + return -1; + } explicitly_launched = false; } else { try {