Skip to content

Commit

Permalink
Make completion work again (#6138)
Browse files Browse the repository at this point in the history
  • Loading branch information
briandealwis authored Jul 7, 2021
1 parent 0aee0cd commit 2d766a1
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions cmd/skaffold/app/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,22 +78,26 @@ func NewSkaffoldCommand(out, errOut io.Writer) *cobra.Command {
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
cmd.Root().SilenceUsage = true

opts.Command = cmd.Use
instrumentation.SetCommand(cmd.Use)
out := output.GetWriter(out, defaultColor, forceColors)
if timestamps {
l := logrus.New()
l.SetOutput(out)
l.SetFormatter(&logrus.TextFormatter{
DisableTimestamp: false,
})
out = l.Writer()
}
cmd.Root().SetOutput(out)
opts.Command = cmd.Name()
// Don't redirect output for Cobra internal `__complete` and `__completeNoDesc` commands.
// These are used for command completion and send debug messages on stderr.
if cmd.Name() != cobra.ShellCompRequestCmd && cmd.Name() != cobra.ShellCompNoDescRequestCmd {
instrumentation.SetCommand(cmd.Name())
out := output.GetWriter(out, defaultColor, forceColors)
if timestamps {
l := logrus.New()
l.SetOutput(out)
l.SetFormatter(&logrus.TextFormatter{
DisableTimestamp: false,
})
out = l.Writer()
}
cmd.Root().SetOutput(out)

// Setup logs
if err := setUpLogs(errOut, v, timestamps); err != nil {
return err
// Setup logs
if err := setUpLogs(errOut, v, timestamps); err != nil {
return err
}
}

// Setup kubeContext and kubeConfig
Expand Down

0 comments on commit 2d766a1

Please sign in to comment.