Skip to content

Commit 856d1f5

Browse files
authored
doc(shorthand): Clarify 'branch rm' is not a shorthand (#750)
Mention that commands only have one shorthand. For `branch delete`, `rm` is an alias, not a shorthand. Resolves #730
1 parent 38d738d commit 856d1f5

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

doc/src/cli/shorthand.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Usage: gs branch (b) create (c) [<name>] [flags]
2222

2323
The shorthand for a command is the bits in parentheses joined together.
2424
For example, the shorthand for $$gs branch create$$ above is `gs bc`.
25-
Another example:
25+
26+
As another example, the shorthand for $$gs branch checkout$$ is `gs bco`.
2627

2728
```freeze language="terminal"
2829
{green}${reset} gs branch checkout --help
@@ -31,7 +32,25 @@ Usage: gs branch (b) checkout (co) [<branch>] [flags]
3132
{gray}# ...{reset}
3233
```
3334

34-
The shorthand for $$gs branch checkout$$ is `gs bco`.
35+
Some commands have multiple aliases, but there's always only one shorthand.
36+
For example, $$gs branch delete$$ has two aliases: `d` and `rm`.
37+
38+
```freeze language="terminal"
39+
{green}${reset} gs branch delete --help
40+
Usage: gs branch (b) delete (d,rm) [<branches> ...] [flags]
41+
42+
{gray}# ...{reset}
43+
```
44+
45+
So valid ways to invoke the command are:
46+
47+
```freeze language="terminal"
48+
{green}${reset} gs bd
49+
{green}${reset} gs b d
50+
{green}${reset} gs b rm
51+
{green}${reset} gs branch rm
52+
{green}${reset} gs branch delete
53+
```
3554

3655
!!! question "When to use built-in shorthands?"
3756

0 commit comments

Comments
 (0)