From b9ef49b51c6e2570ef3aae824ab44374997b6b25 Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Mon, 4 Feb 2019 23:23:16 +0100 Subject: [feat] add -disable-autostart flag and config Make possible to disable the autostart configuration for the next run. I can be done by configuring "DisableAustostart" to true in the systra.json or by passing the '-disable-autostart' flag to the binary. To make that possible I have rework how the Config struct work separating the file configuration with the runtime configuration. - Resolves: #100 --- cmd/bitmask-vpn/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/bitmask-vpn/main.go b/cmd/bitmask-vpn/main.go index a9b2389..ad85b0e 100644 --- a/cmd/bitmask-vpn/main.go +++ b/cmd/bitmask-vpn/main.go @@ -49,13 +49,20 @@ func main() { conf := systray.ParseConfig() - flag.BoolVar(&conf.SelectGateway, "select-gateway", false, "Enable gateway selection") + selectGateway := flag.Bool("select-gateway", false, "Enable gateway selection") + disableAutostart := flag.Bool("disable-autostart", false, "Disable the autostart for the next run") versionFlag := flag.Bool("version", false, "Version of the bitmask-systray") flag.Parse() if *versionFlag { fmt.Println(version) os.Exit(0) } + if *selectGateway { + conf.SelectGateway = *selectGateway + } + if *disableAutostart { + conf.DisableAustostart = *disableAutostart + } conf.Version = version conf.Printer = initPrinter() -- cgit v1.2.3