Skip to content

Commit

Permalink
feat(rename): shorthand is now capital -R and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olets committed Mar 7, 2020
1 parent 7418fac commit c0cdce2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -157,7 +157,7 @@ Default is user.
| --import-git-aliases [--dry-run]
| (--list | -l)
| (--list-commands | -L | -s) [(--session | -S) | (--user | -U)] [(--global | -g)]
| (--rename | -r ) [(--global | -g)] [--dry-run] args
| (--rename | -R ) [(--global | -g)] [--dry-run] args
]
```

Expand Down Expand Up @@ -407,7 +407,7 @@ b
#### Rename

```shell
abbr (--rename | -r) [(--global | -g)] [--dry-run] OLD_WORD NEW_WORD
abbr (--rename | -R) [(--global | -g)] [--dry-run] OLD_WORD NEW_WORD
```

Rename an abbreviation.
Expand Down
4 changes: 2 additions & 2 deletions tests/tests.plugin.zsh
Expand Up @@ -89,9 +89,9 @@ fi
echo $message
abbr -e $test_abbr_abbreviation

message="abbr -r "
message="abbr -R "
abbr $test_abbr
abbr -r $test_abbr_abbreviation ${test_abbr_abbreviation}_new
abbr -R $test_abbr_abbreviation ${test_abbr_abbreviation}_new
if [[ $(abbr -x ${test_abbr_abbreviation}_new) == $test_abbr_expansion ]]; then
message+="passed"
else
Expand Down
Binary file added v3.0.1.tar.gz
Binary file not shown.
8 changes: 4 additions & 4 deletions zsh-abbr.zsh
Expand Up @@ -109,7 +109,7 @@ _zsh_abbr() {
o --list -l Lists all ABBREVIATIONs.
o --rename OLD_ABBREVIATION NEW_ABBREVIATION
or -r OLD_ABBREVIATION NEW_ABBREVIATION Renames an abbreviation,
or -R OLD_ABBREVIATION NEW_ABBREVIATION Renames an abbreviation,
from OLD_ABBREVIATION to NEW_ABBREVIATION.
o --list-commands or -L (or fishy -s) Show all abbreviations in a
Expand Down Expand Up @@ -182,12 +182,12 @@ _zsh_abbr() {
Erase the session gco abbreviation.
${text_bold}abbr${text_reset} -r -g gco gch
${text_bold}abbr${text_reset} -R -g gco gch
${text_bold}abbr${text_reset} --rename --session gco gch
Rename the existing session abbreviation from gco to gch.
${text_bold}abbr${text_reset} -r l le
${text_bold}abbr${text_reset} -R l le
${text_bold}abbr${text_reset} --rename l le
Rename the existing user abbreviation from l to le. Note that you
Expand Down Expand Up @@ -724,7 +724,7 @@ _zsh_abbr() {
((number_opts++))
;;
"--rename"|\
"-r")
"-R")
[ "$action_set" = true ] && util_bad_options
action_set=true
opt_rename=true
Expand Down

0 comments on commit c0cdce2

Please sign in to comment.