[polari] app: Process --version locally
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] app: Process --version locally
- Date: Sat, 11 May 2019 21:56:18 +0000 (UTC)
commit b6a976fccacaa22c17d2e04886e1143ae4251465
Author: Florian Müllner <fmuellner gnome org>
Date: Sat May 11 13:30:53 2019 +0200
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
src/application.js | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 3940296..67f2018 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]