Skip to content
Myr

Completion: Capitalize short desc, and remove extra space from long (#1455)

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

authored by Frank Chiarulli Jr · committed by GitHub · parent dd40ab0 · Browse files · 2 files+9 added−14 removed
This commit

State

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

Diff stats

2 files+9 added−14 removed

  • other:+9 added−14 removed

2 files+9 added−14 removed

modified:completions_test.go+2 added-2 removed
123 unmodified lines
124 }125126 expected = strings.Join([]string{127 "aliased\tA command with aliases",128 "completion\tgenerate the autocompletion script for the specified shell",128 "completion\tGenerate the autocompletion script for the specified shell",129 "firstChild\tFirst command",130 "help\tHelp about any command",131 "secondChild",132 ":4",
446 unmodified lines
579 }580581 expected := strings.Join([]string{582 "childCmd\tfirst command",583 "completion\tgenerate the autocompletion script for the specified shell",583 "completion\tGenerate the autocompletion script for the specified shell",584 "help\tHelp about any command",585 ":4",586 "Completion ended with directive: ShellCompDirectiveNoFileComp", ""}, "\n")587
2019 unmodified lines
modified:completions.go+7 added-12 removed
597 unmodified lines
598 haveNoDescFlag := !c.CompletionOptions.DisableNoDescFlag && !c.CompletionOptions.DisableDescriptions599600 completionCmd := &Command{601 Use: compCmdName,602 Short: "generate the autocompletion script for the specified shell",603 Long: fmt.Sprintf(`604Generate the autocompletion script for %[1]s for the specified shell.602 Short: "Generate the autocompletion script for the specified shell",603 Long: fmt.Sprintf(`Generate the autocompletion script for %[1]s for the specified shell.604See each sub-command's help for details on how to use the generated script.605`, c.Root().Name()),606 Args: NoArgs,607 ValidArgsFunction: NoFileCompletions,
1 unmodified line
609 c.AddCommand(completionCmd)610611 out := c.OutOrStdout()612 noDesc := c.CompletionOptions.DisableDescriptions614 shortDesc := "generate the autocompletion script for %s"613 shortDesc := "Generate the autocompletion script for %s"614 bash := &Command{615 Use: "bash",616 Short: fmt.Sprintf(shortDesc, "bash"),618 Long: fmt.Sprintf(`619Generate the autocompletion script for the bash shell.617 Long: fmt.Sprintf(`Generate the autocompletion script for the bash shell.618619This script depends on the 'bash-completion' package.620If it is not installed already, you can install it via your OS's package manager.621
26 unmodified lines
648649 zsh := &Command{650 Use: "zsh",651 Short: fmt.Sprintf(shortDesc, "zsh"),654 Long: fmt.Sprintf(`655Generate the autocompletion script for the zsh shell.652 Long: fmt.Sprintf(`Generate the autocompletion script for the zsh shell.653654If shell completion is not already enabled in your environment you will need655to enable it. You can execute the following once:656
26 unmodified lines
683684 fish := &Command{685 Use: "fish",686 Short: fmt.Sprintf(shortDesc, "fish"),690 Long: fmt.Sprintf(`691Generate the autocompletion script for the fish shell.687 Long: fmt.Sprintf(`Generate the autocompletion script for the fish shell.688689To load completions in your current shell session:690691 %[1]s completion fish | source
16 unmodified lines
708709 powershell := &Command{710 Use: "powershell",711 Short: fmt.Sprintf(shortDesc, "powershell"),716 Long: fmt.Sprintf(`717Generate the autocompletion script for powershell.712 Long: fmt.Sprintf(`Generate the autocompletion script for powershell.713714To load completions in your current shell session:715716 %[1]s completion powershell | Out-String | Invoke-Expression
82 unmodified lines