[polari/gnome-3-32] app: Process --version locally
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/gnome-3-32] app: Process --version locally
- Date: Sat, 11 May 2019 21:56:45 +0000 (UTC)
commit bf37b446d0fcd948feafdb66460d92f753c04a71
Author: Florian Müllner <fmuellner gnome org>
Date: Sat May 11 11:30:53 2019 +0000
app: Process --version locally
We currently handle the option after registering the application, which
means we will fire up the telepathy client and connect accounts. This
is not the behavior one would expect, which is to simply print the
version and exit.
https://gitlab.gnome.org/GNOME/polari/merge_requests/119
(cherry picked from commit b6a976fccacaa22c17d2e04886e1143ae4251465)
src/application.js | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 1411182..bec3484 100644
--- a/src/application.js
+++ b/src/application.js
@@ -53,7 +53,13 @@ var Application = GObject.registerClass({
GLib.OptionFlags.NONE, GLib.OptionArg.NONE,
_('Print version and exit'), null);
this.connect('handle-local-options', (o, dict) => {
- let v = dict.lookup_value('test-instance', null);
+ let v = dict.lookup_value('version', null);
+ if (v && v.get_boolean()) {
+ print(`Polari ${pkg.version}`);
+ return 0;
+ }
+
+ v = dict.lookup_value('test-instance', null);
if (v && v.get_boolean())
this._maybeMakeNonUnique();
@@ -69,12 +75,6 @@ var Application = GObject.registerClass({
return 0;
}
- v = dict.lookup_value('version', null);
- if (v && v.get_boolean()) {
- print(`Polari ${pkg.version}`);
- return 0;
- }
-
return -1;
});
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]