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
Provenance
- Commit
c3573e2- Tree
12e0a8d- Author
Frank Chiarulli Jr <frank@frankchiarulli.com>- Committer
GitHub <noreply@github.com>- Parent
dd40ab0
2 files changed+9 added−14 removed
modified:completions_test.go+2 added-2 removed
123 unmodified lines124 }125 126 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 lines579 }580 581 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 linesmodified:completions.go+7 added-12 removed
597 unmodified lines598 haveNoDescFlag := !c.CompletionOptions.DisableNoDescFlag && !c.CompletionOptions.DisableDescriptions599 600 completionCmd := &Command{601 Use: compCmdName,602- Short: "generate the autocompletion script for the specified shell",603- Long: fmt.Sprintf(`604-Generate 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.604 See 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 line609 c.AddCommand(completionCmd)610 611 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(`619-Generate the autocompletion script for the bash shell.617+ Long: fmt.Sprintf(`Generate the autocompletion script for the bash shell.618 619 This script depends on the 'bash-completion' package.620 If it is not installed already, you can install it via your OS's package manager.621 26 unmodified lines648 649 zsh := &Command{650 Use: "zsh",651 Short: fmt.Sprintf(shortDesc, "zsh"),654- Long: fmt.Sprintf(`655-Generate the autocompletion script for the zsh shell.652+ Long: fmt.Sprintf(`Generate the autocompletion script for the zsh shell.653 654 If shell completion is not already enabled in your environment you will need655 to enable it. You can execute the following once:656 26 unmodified lines683 684 fish := &Command{685 Use: "fish",686 Short: fmt.Sprintf(shortDesc, "fish"),690- Long: fmt.Sprintf(`691-Generate the autocompletion script for the fish shell.687+ Long: fmt.Sprintf(`Generate the autocompletion script for the fish shell.688 689 To load completions in your current shell session:690 691 %[1]s completion fish | source16 unmodified lines708 709 powershell := &Command{710 Use: "powershell",711 Short: fmt.Sprintf(shortDesc, "powershell"),716- Long: fmt.Sprintf(`717-Generate the autocompletion script for powershell.712+ Long: fmt.Sprintf(`Generate the autocompletion script for powershell.713 714 To load completions in your current shell session:715 716 %[1]s completion powershell | Out-String | Invoke-Expression82 unmodified lines