summaryrefslogtreecommitdiff
path: root/lib/sway/cli.vala
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sway/cli.vala')
-rw-r--r--lib/sway/cli.vala28
1 files changed, 8 insertions, 20 deletions
diff --git a/lib/sway/cli.vala b/lib/sway/cli.vala
index c51264b..19cf5ca 100644
--- a/lib/sway/cli.vala
+++ b/lib/sway/cli.vala
@@ -1,11 +1,12 @@
static bool help;
static bool version;
-static bool monitor;
+static bool test;
const OptionEntry[] options = {
{ "version", 'v', OptionFlags.NONE, OptionArg.NONE, ref version, null, null },
{ "help", 'h', OptionFlags.NONE, OptionArg.NONE, ref help, null, null },
- { "monitor", 'm', OptionFlags.NONE, OptionArg.NONE, ref monitor, null, null },
+ { "test", 't', OptionFlags.NONE, OptionArg.NONE, ref test, null, null },
+ // { "monitor", 'm', OptionFlags.NONE, OptionArg.NONE, ref monitor, null, null },
{ null },
};
@@ -21,30 +22,17 @@ int main(string[] argv) {
return 1;
}
- if (help) {
- print("Usage:\n");
- print(" %s [flags]\n\n", argv[0]);
- print("Flags:\n");
- print(" -h, --help Print this help and exit\n");
- print(" -v, --version Print version number and exit\n");
- print(" -m, --monitor Monitor property changes\n");
+ if (test) {
+ var loop = new MainLoop();
+ AstalSway.get_default();
+ loop.run();
return 0;
}
if (version) {
- print(AstalBattery.VERSION);
+ print(AstalSway.VERSION);
return 0;
}
- var battery = AstalBattery.get_default();
- print("%s\n", Json.gobject_to_data(battery, null));
-
- if (monitor) {
- battery.notify.connect(() => {
- print("%s\n", Json.gobject_to_data(battery, null));
- });
- new GLib.MainLoop(null, false).run();
- }
-
return 0;
}