commands: Properly handle CLI slice arguments

Like `--disableKinds` -- this handling was kind of broken when we recently moved this from global vars

See #4607
This commit is contained in:
Bjørn Erik Pedersen 2018-04-14 10:34:02 +02:00
parent bede93de00
commit 27a524b090
2 changed files with 19 additions and 1 deletions

View file

@ -57,8 +57,10 @@ func TestCommandsPersistentFlags(t *testing.T) {
}{{[]string{"server",
"--config=myconfig.toml",
"--contentDir=mycontent",
"--disableKinds=page,home",
"--layoutDir=mylayouts",
"--theme=mytheme",
"--gc",
"--themesDir=mythemes",
"--cleanDestinationDir",
"--navigateToChanged",
@ -100,7 +102,10 @@ func TestCommandsPersistentFlags(t *testing.T) {
assert.Equal("mytheme", cfg.GetString("theme"))
assert.Equal("mythemes", cfg.GetString("themesDir"))
assert.Equal([]string{"page", "home"}, cfg.Get("disableKinds"))
assert.True(cfg.GetBool("uglyURLs"))
assert.True(cfg.GetBool("gc"))
// The flag is named i18n-warnings
assert.True(cfg.GetBool("logI18nWarnings"))