Skip to content

Commit

Permalink
add an env to disable the completions
Browse files Browse the repository at this point in the history
  • Loading branch information
pomdtr committed Feb 25, 2025
1 parent 1f4c444 commit b8bc726
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ func NewCmdRoot() *cobra.Command {
rootCmd.AddCommand(NewCmdConfig())
rootCmd.AddCommand(NewCmdSecrets())

if _, ok := os.LookupEnv("SMALLWEB_DISABLE_COMPLETIONS"); ok {
rootCmd.CompletionOptions.DisableDefaultCmd = true
}

if env, ok := os.LookupEnv("SMALLWEB_DISABLED_COMMANDS"); ok {
disabledCommands := strings.Split(env, ",")
for _, commandName := range disabledCommands {
Expand Down

0 comments on commit b8bc726

Please sign in to comment.