-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: auto alias subcmds with hyphens for underscores (#336)
- Loading branch information
Showing
5 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tests/snapshots/integration__compgen__auto_alias_subcommand.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
source: tests/compgen.rs | ||
expression: data | ||
--- | ||
************ COMPGEN `prog ` ************ | ||
cmd_a /color:magenta | ||
cmd-a /color:magenta | ||
help /color:magenta | ||
|
||
************ COMPGEN `prog cmd` ************ | ||
cmd_a /color:magenta | ||
cmd-a /color:magenta |
52 changes: 52 additions & 0 deletions
52
tests/snapshots/integration__spec__auto_alias_subcommand.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
source: tests/spec.rs | ||
expression: data | ||
--- | ||
************ RUN ************ | ||
prog -h | ||
|
||
# OUTPUT | ||
command cat >&2 <<-'EOF' | ||
USAGE: prog <COMMAND> | ||
|
||
COMMANDS: | ||
cmd_a [aliases: cmd-a] | ||
|
||
EOF | ||
exit 0 | ||
|
||
# RUN_OUTPUT | ||
USAGE: prog <COMMAND> | ||
|
||
COMMANDS: | ||
cmd_a [aliases: cmd-a] | ||
|
||
************ RUN ************ | ||
prog cmd_a | ||
|
||
# OUTPUT | ||
argc__args=( prog cmd_a ) | ||
argc__fn=cmd_a | ||
argc__positionals=( ) | ||
cmd_a | ||
|
||
# RUN_OUTPUT | ||
argc__args=([0]="prog" [1]="cmd_a") | ||
argc__fn=cmd_a | ||
argc__positionals=() | ||
cmd_a | ||
|
||
************ RUN ************ | ||
prog cmd-a | ||
|
||
# OUTPUT | ||
argc__args=( prog cmd-a ) | ||
argc__fn=cmd_a | ||
argc__positionals=( ) | ||
cmd_a | ||
|
||
# RUN_OUTPUT | ||
argc__args=([0]="prog" [1]="cmd-a") | ||
argc__fn=cmd_a | ||
argc__positionals=() | ||
cmd_a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters