@@ -95,6 +95,10 @@ func TestBashCompletions(t *testing.T) {
9595 rootCmd .Flags ().String ("theme" , "" , "theme to use (located in /themes/THEMENAME/)" )
9696 rootCmd .Flags ().SetAnnotation ("theme" , BashCompSubdirsInDir , []string {"themes" })
9797
98+ // For two word flags check
99+ rootCmd .Flags ().StringP ("two" , "t" , "" , "this is two word flags" )
100+ rootCmd .Flags ().BoolP ("two-w-default" , "T" , false , "this is not two word flags" )
101+
98102 echoCmd := & Command {
99103 Use : "echo [string to echo]" ,
100104 Aliases : []string {"say" },
@@ -183,6 +187,12 @@ func TestBashCompletions(t *testing.T) {
183187 // check for subdirs_in_dir flags in a subcommand
184188 checkRegex (t , output , fmt .Sprintf (`_root_echo\(\)\n{[^}]*flags_completion\+=\("__%s_handle_subdirs_in_dir_flag config"\)` , rootCmd .Name ()))
185189
190+ // check two word flags
191+ check (t , output , `two_word_flags+=("--two")` )
192+ check (t , output , `two_word_flags+=("-t")` )
193+ checkOmit (t , output , `two_word_flags+=("--two-w-default")` )
194+ checkOmit (t , output , `two_word_flags+=("-T")` )
195+
186196 checkOmit (t , output , deprecatedCmd .Name ())
187197
188198 // If available, run shellcheck against the script.
0 commit comments