mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 04:43:10 +00:00
abbr: rename --remove to --erase
for consistency with other fish commands Closes #2071.
This commit is contained in:
parent
edf6a951ee
commit
c0cf25cf0b
4 changed files with 9 additions and 9 deletions
|
@ -5,7 +5,7 @@
|
||||||
abbr -a word="phrase"
|
abbr -a word="phrase"
|
||||||
abbr -s
|
abbr -s
|
||||||
abbr -l
|
abbr -l
|
||||||
abbr -r word
|
abbr -e word
|
||||||
\endfish
|
\endfish
|
||||||
|
|
||||||
\subsection abbr-description Description
|
\subsection abbr-description Description
|
||||||
|
@ -24,7 +24,7 @@ The following parameters are available:
|
||||||
|
|
||||||
- `-l` or `--list` Lists all abbreviated words.
|
- `-l` or `--list` Lists all abbreviated words.
|
||||||
|
|
||||||
- `-r WORD` or `--remove WORD` Remove the abbreviation WORD.
|
- `-e WORD` or `--erase WORD` Erase the abbreviation WORD.
|
||||||
|
|
||||||
\subsection abbr-example Examples
|
\subsection abbr-example Examples
|
||||||
|
|
||||||
|
@ -34,9 +34,9 @@ abbr -a gco git checkout
|
||||||
Add a new abbreviation where `gco` will be replaced with `git checkout`.
|
Add a new abbreviation where `gco` will be replaced with `git checkout`.
|
||||||
|
|
||||||
\fish
|
\fish
|
||||||
abbr -r gco
|
abbr -e gco
|
||||||
\endfish
|
\endfish
|
||||||
Remove the `gco` abbreviation.
|
Erase the `gco` abbreviation.
|
||||||
|
|
||||||
\fish
|
\fish
|
||||||
ssh another_host abbr -s | source
|
ssh another_host abbr -s | source
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
complete -c abbr -f -s a -l add -d 'Add abbreviation'
|
complete -c abbr -f -s a -l add -d 'Add abbreviation'
|
||||||
complete -c abbr -s r -l remove -d 'Remove abbreviation' -xa '(abbr -l)'
|
complete -c abbr -s e -l erase -d 'Erase abbreviation' -xa '(abbr -l)'
|
||||||
complete -c abbr -f -s s -l show -d 'Print all abbreviations'
|
complete -c abbr -f -s s -l show -d 'Print all abbreviations'
|
||||||
complete -c abbr -f -s l -l list -d 'Print all abbreviation names'
|
complete -c abbr -f -s l -l list -d 'Print all abbreviation names'
|
||||||
complete -c abbr -f -s h -l help -d 'Help'
|
complete -c abbr -f -s h -l help -d 'Help'
|
||||||
|
|
|
@ -26,8 +26,8 @@ function abbr --description "Manage abbreviations"
|
||||||
case '-a' '--add'
|
case '-a' '--add'
|
||||||
set new_mode add
|
set new_mode add
|
||||||
set needs_arg coalesce
|
set needs_arg coalesce
|
||||||
case '-r' '--remove'
|
case '-e' '--erase'
|
||||||
set new_mode remove
|
set new_mode erase
|
||||||
set needs_arg single
|
set needs_arg single
|
||||||
case '-l' '--list'
|
case '-l' '--list'
|
||||||
set new_mode list
|
set new_mode list
|
||||||
|
@ -91,7 +91,7 @@ function abbr --description "Manage abbreviations"
|
||||||
set fish_user_abbreviations $fish_user_abbreviations $mode_arg
|
set fish_user_abbreviations $fish_user_abbreviations $mode_arg
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
case 'remove'
|
case 'erase'
|
||||||
set -l key
|
set -l key
|
||||||
__fish_abbr_parse_entry $mode_arg key
|
__fish_abbr_parse_entry $mode_arg key
|
||||||
if set -l idx (__fish_abbr_get_by_key $key)
|
if set -l idx (__fish_abbr_get_by_key $key)
|
||||||
|
|
|
@ -702,7 +702,7 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def do_remove_abbreviation(self, abbreviation):
|
def do_remove_abbreviation(self, abbreviation):
|
||||||
out, err = run_fish_cmd('abbr -r %s' % abbreviation['word'])
|
out, err = run_fish_cmd('abbr -e %s' % abbreviation['word'])
|
||||||
if out or err:
|
if out or err:
|
||||||
return err
|
return err
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue