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

Proposed by David Hewitt on 2017-04-17
Status: Merged
Approved by: Daniel Fore on 2017-04-21
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
Daniel Fore 2017-04-17 Approve on 2017-04-21
Review via email:

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:

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.
Daniel Fore (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 @@
6 context.add_main_entries (options, null);
7 context.add_group (Gtk.get_option_group (false));
8+ context.set_ignore_unknown_options (true);
10 try {
11 context.parse (ref args);


People subscribed via source and target branches