mirror of
https://github.com/abhinav/git-spice.git
synced 2026-08-31 07:47:47 +02:00
completion: Rename to shell completion (#167)
We expect a 'shell prompt' command in the future that could be used in a shell prompt. Put completion under the same namespace instead of polluting top level.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
kind: Changed
|
||||
body: (*Breaking*) Rename `completion` to `shell completion`. Other shell helpers are expected in the future.
|
||||
time: 2024-06-08T09:16:34.91796-07:00
|
||||
+7
-8
@@ -14,27 +14,26 @@ gs (git-spice) is a command line tool for stacking Git branches.
|
||||
* `-C`, `--dir=DIR`: Change to DIR before doing anything
|
||||
* `--[no-]prompt`: Whether to prompt for missing information
|
||||
|
||||
## gs completion
|
||||
## gs shell completion
|
||||
|
||||
```
|
||||
gs completion <shell> [flags]
|
||||
gs shell completion <shell>
|
||||
```
|
||||
|
||||
Generate shell completion script
|
||||
|
||||
Generates shell completion scripts.
|
||||
To install the script, add the output of this command to your
|
||||
shell's rc file.
|
||||
For example:
|
||||
To install the script, add the following line to your shell's
|
||||
rc file.
|
||||
|
||||
# bash
|
||||
gs completion bash >> ~/.bashrc
|
||||
eval "$(gs shell completion bash)"
|
||||
|
||||
# zsh
|
||||
gs completion zsh >> ~/.zshrc
|
||||
eval "$(gs shell completion zsh)"
|
||||
|
||||
# fish
|
||||
gs completion fish >> ~/.config/fish/config.fish
|
||||
eval "$(gs shell completion fish)"
|
||||
|
||||
**Arguments**
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ type globalOptions struct {
|
||||
type mainCmd struct {
|
||||
globalOptions `group:"globals"`
|
||||
|
||||
Completion completionCmd `cmd:"" group:"Setup" help:"Generate shell completion script"`
|
||||
Shell shellCmd `cmd:"" group:"Shell"`
|
||||
|
||||
Repo repoCmd `cmd:"" aliases:"r" group:"Repository"`
|
||||
Log logCmd `cmd:"" aliases:"l" group:"Log"`
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package main
|
||||
|
||||
type shellCmd struct {
|
||||
Completion shellCompletionCmd `cmd:"" help:"Generate shell completion script"`
|
||||
}
|
||||
@@ -11,25 +11,24 @@ import (
|
||||
"go.abhg.dev/gs/internal/text"
|
||||
)
|
||||
|
||||
type completionCmd struct {
|
||||
type shellCompletionCmd struct {
|
||||
*komplete.Command `embed:""`
|
||||
}
|
||||
|
||||
func (c *completionCmd) Help() string {
|
||||
func (c *shellCompletionCmd) Help() string {
|
||||
return text.Dedent(`
|
||||
Generates shell completion scripts.
|
||||
To install the script, add the output of this command to your
|
||||
shell's rc file.
|
||||
For example:
|
||||
To install the script, add the following line to your shell's
|
||||
rc file.
|
||||
|
||||
# bash
|
||||
gs completion bash >> ~/.bashrc
|
||||
eval "$(gs shell completion bash)"
|
||||
|
||||
# zsh
|
||||
gs completion zsh >> ~/.zshrc
|
||||
eval "$(gs shell completion zsh)"
|
||||
|
||||
# fish
|
||||
gs completion fish >> ~/.config/fish/config.fish
|
||||
eval "$(gs shell completion fish)"
|
||||
`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user