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

@@ -70,7 +70,7 @@ func (r Response) IsUserError() bool {
// Execute adds all child commands to the root command HugoCmd and sets flags appropriately.
// The args are usually filled with os.Args[1:].
func Execute(args []string) Response {
hugoCmd := newHugoCompleteCmd()
hugoCmd := newCommandsBuilder().addAll().build()
cmd := hugoCmd.getCommand()
cmd.SetArgs(args)