mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
test: Fix login from opening URLs automatically (#334)
When using VS Code's test on save, this was funny behavior 🤣.
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
|
||||
const (
|
||||
varGlobalConfig = "global-config"
|
||||
varNoOpen = "no-open"
|
||||
varForceTty = "force-tty"
|
||||
)
|
||||
|
||||
@@ -71,6 +72,11 @@ func Root() *cobra.Command {
|
||||
// This should never return an error, because we just added the `--force-tty`` flag prior to calling MarkHidden.
|
||||
panic(err)
|
||||
}
|
||||
cmd.PersistentFlags().Bool(varNoOpen, false, "Block automatically opening URLs in the browser.")
|
||||
err = cmd.PersistentFlags().MarkHidden(varNoOpen)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user