[gnome-boxes/dont-override-help-cmdline-option] app: Don't override -h command line option



commit fd362c2770446e3541e22bc285399724bf17f688
Author: Felipe Borges <felipeborges gnome org>
Date:   Mon Aug 12 15:02:46 2019 +0200

    app: Don't override -h command line option
    
    The GLib internal call in https://gitlab.gnome.org/GNOME/glib/blob/master/glib/goption.c#L978
    decides whether to use '-h' or '-?'. The context_has_h_entry ()
    method looks up in the application-defined "main" option group
    for an override in '-h', and if its been re-defined, it will
    print '-?' instead.
    
    See commit https://gitlab.gnome.org/GNOME/glib/commit/49172a71aacdd855918b614f3d61fa5b9248fb85
    
    The solution for this in Boxes is to just delete our help option
    definition, so we don't override GLib's default option, and let it
    print '-h' instead.
    
    Fixes #384

 src/app.vala | 1 -
 1 file changed, 1 deletion(-)
---
diff --git a/src/app.vala b/src/app.vala
index 76de7511..c77b5e04 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -169,7 +169,6 @@ public override void activate () {
     static string[] opt_search;
     const OptionEntry[] options = {
         { "version", 0, 0, OptionArg.NONE, null, N_("Display version number"), null },
-        { "help", 'h', OptionFlags.HIDDEN, OptionArg.NONE, ref opt_help, null, null },
         { "full-screen", 'f', 0, OptionArg.NONE, ref opt_fullscreen, N_("Open in full screen"), null },
         { "checks", 0, 0, OptionArg.NONE, null, N_("Check virtualization capabilities"), null },
         { "open-uuid", 0, 0, OptionArg.STRING, ref opt_open_uuid, N_("Open box with UUID"), null },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]