@@ -258,14 +258,13 @@ func ExampleCommand_Run_shellComplete_bash_withShortFlag() {
258258 }
259259
260260 // Simulate a bash environment and command line arguments
261- os .Setenv ("SHELL" , "bash" )
262261 os .Args = []string {"greet" , "-" , "--generate-shell-completion" }
263262
264263 _ = cmd .Run (context .Background (), os .Args )
265264 // Output:
266265 // --other
267266 // --xyz
268- // --help
267+ // --help:show help
269268}
270269
271270func ExampleCommand_Run_shellComplete_bash_withLongFlag () {
@@ -291,7 +290,6 @@ func ExampleCommand_Run_shellComplete_bash_withLongFlag() {
291290 }
292291
293292 // Simulate a bash environment and command line arguments
294- os .Setenv ("SHELL" , "bash" )
295293 os .Args = []string {"greet" , "--s" , "--generate-shell-completion" }
296294
297295 _ = cmd .Run (context .Background (), os .Args )
@@ -326,7 +324,6 @@ func ExampleCommand_Run_shellComplete_bash_withMultipleLongFlag() {
326324 }
327325
328326 // Simulate a bash environment and command line arguments
329- os .Setenv ("SHELL" , "bash" )
330327 os .Args = []string {"greet" , "--st" , "--generate-shell-completion" }
331328
332329 _ = cmd .Run (context .Background (), os .Args )
@@ -362,14 +359,13 @@ func ExampleCommand_Run_shellComplete_bash() {
362359 }
363360
364361 // Simulate a bash environment and command line arguments
365- os .Setenv ("SHELL" , "bash" )
366362 os .Args = []string {"greet" , "--generate-shell-completion" }
367363
368364 _ = cmd .Run (context .Background (), os .Args )
369365 // Output:
370- // describeit
371- // next
372- // help
366+ // describeit:use it to see a description
367+ // next:next example
368+ // help:Shows a list of commands or help for one command
373369}
374370
375371func ExampleCommand_Run_shellComplete_zsh () {
@@ -400,7 +396,6 @@ func ExampleCommand_Run_shellComplete_zsh() {
400396
401397 // Simulate a zsh environment and command line arguments
402398 os .Args = []string {"greet" , "--generate-shell-completion" }
403- os .Setenv ("SHELL" , "/usr/bin/zsh" )
404399
405400 _ = cmd .Run (context .Background (), os .Args )
406401 // Output:
@@ -437,7 +432,6 @@ func ExampleCommand_Run_shellComplete_fish() {
437432
438433 // Simulate a fish environment and command line arguments
439434 os .Args = []string {"greet" , "--generate-shell-completion" }
440- os .Setenv ("SHELL" , "/usr/bin/fish" )
441435
442436 _ = cmd .Run (context .Background (), os .Args )
443437 // Output:
0 commit comments