Skip to content
Myr

Merge pull request #327 from bogem/fixes

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Some small fixes

authored by Eric Paris · committed by GitHub · parents 7c674d9, 6e17f4e · Browse files · 3 files+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+4 added−4 removed

  • other:+4 added−4 removed

3 files+4 added−4 removed

modified:bash_completions.go+1 added-1 removed
9 unmodified lines
10 "github.com/spf13/pflag"11)1213const (14 BashCompFilenameExt = "cobra_annotation_bash_completion_filename_extentions"14 BashCompFilenameExt = "cobra_annotation_bash_completion_filename_extensions"15 BashCompCustom = "cobra_annotation_bash_completion_custom"16 BashCompOneRequiredFlag = "cobra_annotation_bash_completion_one_required_flag"17 BashCompSubdirsInDir = "cobra_annotation_bash_completion_subdirs_in_dir"18)
625 unmodified lines
modified:cobra_test.go+2 added-2 removed
917 unmodified lines
918 r := noRRSetupTestSilenced("bogus")919 s := "Run 'cobra-test --help' for usage.\n"920921 if r.Output != "" {922 t.Errorf("Unexpected response.\nExpecting to be: \n\"\"\n Got:\n %q\n", s, r.Output)922 t.Errorf("Unexpected response.\nExpecting to be:\n %q\nGot:\n %q\n", s, r.Output)923 }924925 r = noRRSetupTestSilenced("--strtwo=a bogus")926 if r.Output != "" {927 t.Errorf("Unexpected response.\nExpecting to be:\n\"\"\nGot:\n %q\n", s, r.Output)927 t.Errorf("Unexpected response.\nExpecting to be:\n %q\nGot:\n %q\n", s, r.Output)928 }929}930931func TestRootSuggestions(t *testing.T) {
257 unmodified lines
modified:command.go+1 added-1 removed
991 unmodified lines
992 // the command either has no sub commands, or no non-help sub commands993 return true994}995996// HasHelpSubCommands determines if a command has any avilable 'help' sub commands996// HasHelpSubCommands determines if a command has any available 'help' sub commands997// that need to be shown in the usage/help default template under 'additional help998// topics'999func (c *Command) HasHelpSubCommands() bool {1000
256 unmodified lines