commands: Fix handling of persistent CLI flags

See #4607
This commit is contained in:
Bjørn Erik Pedersen
2018-04-13 08:42:29 +02:00
parent f3775877c6
commit 2aab6dee85
6 changed files with 94 additions and 28 deletions

View File

@@ -40,7 +40,8 @@ func TestServer(t *testing.T) {
stop := make(chan bool)
scmd := newServerCmdSignaled(stop)
b := newCommandsBuilder()
scmd := b.newServerCmdSignaled(stop)
cmd := scmd.getCommand()
cmd.SetArgs([]string{"-s=" + dir, fmt.Sprintf("-p=%d", port)})
@@ -90,7 +91,8 @@ func TestFixURL(t *testing.T) {
}
for i, test := range tests {
s := newServerCmd()
b := newCommandsBuilder()
s := b.newServerCmd()
v := viper.New()
baseURL := test.CLIBaseURL
v.Set("baseURL", test.CfgBaseURL)