diff --git a/pkg/visor/api.go b/pkg/visor/api.go index bba1c8413c..47e53df560 100644 --- a/pkg/visor/api.go +++ b/pkg/visor/api.go @@ -529,7 +529,7 @@ func (v *Visor) StartVPNClient(pk cipher.PubKey) error { // we set the args in memory and pass it in `v.appL.StartApp` // unlike the api method `StartApp` where `nil` is passed in `v.appL.StartApp` as args // but the args are set in the config - v.conf.Launcher.Apps[index].Args = []string{"-srv", pk.Hex()} + v.conf.Launcher.Apps[index].Args = []string{"--srv", pk.Hex()} maker := vpnEnvMaker(v.conf, v.dmsgC, v.dmsgDC, v.tpM.STCPRRemoteAddrs()) envs, err = maker() if err != nil { @@ -609,13 +609,13 @@ func (v *Visor) StartSkysocksClient(serverKey string) error { // we set the args in memory and pass it in `v.appL.StartApp` // unlike the api method `StartApp` where `nil` is passed in `v.appL.StartApp` as args // but the args are set in the config - v.conf.Launcher.Apps[index].Args = []string{"-srv", pk.Hex()} + v.conf.Launcher.Apps[index].Args = []string{"--srv", pk.Hex()} } else { var pk cipher.PubKey if err := pk.Set(v.GetSkysocksClientAddress()); err != nil { return err } - v.conf.Launcher.Apps[index].Args = []string{"-srv", pk.Hex()} + v.conf.Launcher.Apps[index].Args = []string{"--srv", pk.Hex()} } // check process manager availability @@ -724,7 +724,7 @@ func (v *Visor) SetAppPassword(appName, password string) error { v.log.Infof("Changing %s password to %q", appName, password) const ( - passcodeArgName = "-passcode" + passcodeArgName = "--passcode" ) if err := v.conf.UpdateAppArg(v.appL, appName, passcodeArgName, password); err != nil { return err @@ -833,7 +833,7 @@ func (v *Visor) SetAppAddress(appName string, address string) error { v.log.Infof("Setting %s addr to %v", appName, address) const ( - addrArg = "-addr" + addrArg = "--addr" ) if err := v.conf.UpdateAppArg(v.appL, appName, addrArg, address); err != nil { return err @@ -863,7 +863,7 @@ func (v *Visor) SetAppPK(appName string, pk cipher.PubKey) error { v.log.Infof("Changing %s PK to %q", appName, pk) const ( - pkArgName = "-srv" + pkArgName = "--srv" ) if err := v.conf.UpdateAppArg(v.appL, appName, pkArgName, pk.String()); err != nil { return err @@ -892,7 +892,7 @@ func (v *Visor) SetAppDNS(appName string, dnsAddr string) error { v.log.Infof("Changing %s DNS Address to %q", appName, dnsAddr) const ( - pkArgName = "-dns" + pkArgName = "--dns" ) if err := v.conf.UpdateAppArg(v.appL, appName, pkArgName, dnsAddr); err != nil { @@ -917,7 +917,7 @@ func (v *Visor) DoCustomSetting(appName string, customSetting map[string]string) } for field, value := range customSetting { - if err := v.conf.UpdateAppArg(v.appL, appName, fmt.Sprintf("-%s", field), value); err != nil { + if err := v.conf.UpdateAppArg(v.appL, appName, fmt.Sprintf("--%s", field), value); err != nil { return err } } @@ -1489,7 +1489,7 @@ func (v *Visor) GetVPNClientAddress() string { for _, v := range v.conf.Launcher.Apps { if v.Name == visorconfig.VPNClientName { for index := range v.Args { - if v.Args[index] == "-srv" { + if v.Args[index] == "--srv" { return v.Args[index+1] } } @@ -1503,7 +1503,7 @@ func (v *Visor) GetSkysocksClientAddress() string { for _, v := range v.conf.Launcher.Apps { if v.Name == visorconfig.SkysocksClientAddr { for index := range v.Args { - if v.Args[index] == "-srv" { + if v.Args[index] == "--srv" { return v.Args[index+1] } }