Skip to content

Commit b4b889a

Browse files
authored
Add detect blocking IO option to Supervisor options (#570)
Add a new detect blocking IO option to the Supervisor options call introduced in home-assistant/supervisor#5746.
1 parent be8b2d1 commit b4b889a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cmd/supervisor_options.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ Supervisor running on your Home Assistant system.`,
3131
for _, value := range []string{
3232
"hostname",
3333
"channel",
34+
"detect-blocking-io",
3435
"timezone",
3536
"logging",
3637
} {
3738
val, err := cmd.Flags().GetString(value)
3839
if val != "" && err == nil && cmd.Flags().Changed(value) {
39-
options[value] = val
40+
options[strings.ReplaceAll(value, "-", "_")] = val
4041
}
4142
}
4243

@@ -79,6 +80,7 @@ Supervisor running on your Home Assistant system.`,
7980
func init() {
8081
supervisorOptionsCmd.Flags().StringP("hostname", "", "", "Hostname to set")
8182
supervisorOptionsCmd.Flags().StringP("channel", "c", "", "Channel to track (stable|beta|dev)")
83+
supervisorOptionsCmd.Flags().StringP("detect-blocking-io", "", "", "Detect blocking IO (on|on-at-startup|off)")
8284
supervisorOptionsCmd.Flags().StringP("timezone", "t", "", "Timezone")
8385
supervisorOptionsCmd.Flags().StringP("logging", "l", "", "Logging: debug|info|warning|error|critical")
8486
supervisorOptionsCmd.Flags().IntP("wait-boot", "w", 0, "Seconds to wait after boot")
@@ -97,6 +99,9 @@ func init() {
9799
supervisorOptionsCmd.RegisterFlagCompletionFunc("channel", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
98100
return []string{"stable", "beta", "dev"}, cobra.ShellCompDirectiveNoFileComp
99101
})
102+
supervisorOptionsCmd.RegisterFlagCompletionFunc("detect-blocking-io", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
103+
return []string{"on", "on-at-startup", "off"}, cobra.ShellCompDirectiveNoFileComp
104+
})
100105
supervisorOptionsCmd.RegisterFlagCompletionFunc("timezone", cobra.NoFileCompletions)
101106
supervisorOptionsCmd.RegisterFlagCompletionFunc("logging", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
102107
return []string{"debug", "info", "warning", "error", "critical"}, cobra.ShellCompDirectiveNoFileComp

0 commit comments

Comments
 (0)