Merge lp:~davidmhewitt/granite/fix-commandline-args into lp:~elementary-pantheon/granite/granite

Proposed by David Hewitt
Status: Merged
Approved by: Danielle Foré
Approved revision: 1044
Merged at revision: 1044
Proposed branch: lp:~davidmhewitt/granite/fix-commandline-args
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 11 lines (+1/-0)
1 file modified
lib/Application.vala (+1/-0)
To merge this branch: bzr merge lp:~davidmhewitt/granite/fix-commandline-args
Reviewer Review Type Date Requested Status
Danielle Foré Approve
Review via email: mp+322618@code.launchpad.net

Commit message

Ignore arguments that aren't recognised by granite

Description of the change

Currently, when granite encounters a command line argument it doesn't recognise (i.e. something that's not -a (about dialog) or -d (debug mode), it stops parsing and passes all arguments (including -a and -d) to the application to handle.

Because the application probably doesn't know about the two granite specific arguments, these are often unrecognised, see: https://github.com/elementary/appcenter/issues/76

If we add the line in this proposal, granite skips over the arguments it doesn't recognise and eats the ones it does. So granite deals with the granite specific args and the application gets the rest.

To post a comment you must log in.
Revision history for this message
Danielle Foré (danrabbit) wrote :

I can confirm that this addresses the issue

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/Application.vala'
2--- lib/Application.vala 2017-01-23 21:52:19 +0000
3+++ lib/Application.vala 2017-04-17 09:59:22 +0000
4@@ -186,6 +186,7 @@
5
6 context.add_main_entries (options, null);
7 context.add_group (Gtk.get_option_group (false));
8+ context.set_ignore_unknown_options (true);
9
10 try {
11 context.parse (ref args);

Subscribers

People subscribed via source and target branches