summaryrefslogtreecommitdiff
path: root/cmd/bitmask-vpn
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2019-02-04 23:23:16 +0100
committerRuben Pollan <meskio@sindominio.net>2019-02-04 23:23:16 +0100
commitb9ef49b51c6e2570ef3aae824ab44374997b6b25 (patch)
tree5fcfcc4931d35b72b1853dff005f0eaca25d00d4 /cmd/bitmask-vpn
parent51a4d191669aaf5e23ec4e1f61aab71419603003 (diff)
[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
Diffstat (limited to 'cmd/bitmask-vpn')
-rw-r--r--cmd/bitmask-vpn/main.go9
1 files changed, 8 insertions, 1 deletions
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()