I needed to add some command option for an app I'm developing. I get the options working nicely after adding the following function
public const GLib.OptionEntry[] options = {
// --version
{ "version", 0, 0, OptionArg.NONE, ref command_line_option_version, "Display version number", null },
// --monitor
{ "monitor", 0, 0, OptionArg.STRING, ref command_line_option_monitor, "PATH", "Path to nutty config (i.e. /home/sid/.config/nutty)" },
// --alert
{ "alert", 0, 0, OptionArg.NONE, ref command_line_option_alert, "Run Nutty in device alert mode", null },
// list terminator
{ null }
};
But then when I right click the app icon the "About" option does not come. and the following warning also explains the reason:
nutty.vala:287.5-296.3: warning: Nutty.options hides inherited constant `Granite.Application.options'. Use the `new' keyword if hiding was intentional
How do I get around this - i.e. how can I add the command line options while still keeping the icon right click behavior intact ? Probably some way I can extend the Granite.Application.options ?
My source code is at the following Launchpad location.