Merge remote-tracking branch 'origin/main' into michaeljs1990-add-flag-category-support

This commit is contained in:
2022-05-22 11:06:38 -04:00
24 changed files with 103 additions and 69 deletions

View File

@@ -228,6 +228,7 @@ func ExampleApp_Run_subcommandNoAction() {
}
func ExampleApp_Run_bashComplete_withShortFlag() {
os.Setenv("SHELL", "bash")
os.Args = []string{"greet", "-", "--generate-bash-completion"}
app := NewApp()
@@ -255,6 +256,7 @@ func ExampleApp_Run_bashComplete_withShortFlag() {
}
func ExampleApp_Run_bashComplete_withLongFlag() {
os.Setenv("SHELL", "bash")
os.Args = []string{"greet", "--s", "--generate-bash-completion"}
app := NewApp()
@@ -283,6 +285,7 @@ func ExampleApp_Run_bashComplete_withLongFlag() {
// --similar-flag
}
func ExampleApp_Run_bashComplete_withMultipleLongFlag() {
os.Setenv("SHELL", "bash")
os.Args = []string{"greet", "--st", "--generate-bash-completion"}
app := NewApp()
@@ -315,7 +318,7 @@ func ExampleApp_Run_bashComplete_withMultipleLongFlag() {
}
func ExampleApp_Run_bashComplete() {
// set args for examples sake
os.Setenv("SHELL", "bash")
os.Args = []string{"greet", "--generate-bash-completion"}
app := &App{
@@ -355,7 +358,7 @@ func ExampleApp_Run_bashComplete() {
func ExampleApp_Run_zshComplete() {
// set args for examples sake
os.Args = []string{"greet", "--generate-bash-completion"}
_ = os.Setenv("_CLI_ZSH_AUTOCOMPLETE_HACK", "1")
_ = os.Setenv("SHELL", "/usr/bin/zsh")
app := NewApp()
app.Name = "greet"