fix: (config) only respect the --command flag once (#2096)

We want to switch to the command specified by the flag, but only at startup.

Afterwards, we should be interactive and favor the user's command choices over the startup commandline switch.
mine
tyzbit 2023-05-21 11:06:37 -04:00 committed by GitHub
parent 288a9d0e87
commit 91cac5e979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -191,6 +191,10 @@ func (c *Config) ActiveView() string {
cmd := cl.View.Active
if c.K9s.manualCommand != nil && *c.K9s.manualCommand != "" {
cmd = *c.K9s.manualCommand
// We reset the manualCommand property because
// the command-line switch should only be considered once,
// on startup.
*c.K9s.manualCommand = ""
}
return cmd