mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-19 18:01:15 -03:00
abbr: Let --function use a mandatory argument
This now means `abbr --add` has two modes: ```fish abbr --add name --function foo --regex regex ``` ```fish abbr --add name --regex regex replacement ``` This is because `--function` was seen to be confusing as a boolean flag.
This commit is contained in:
@@ -133,11 +133,20 @@ echo $status
|
||||
# CHECKERR: abbr: --position option requires --add
|
||||
# CHECK: 2
|
||||
|
||||
abbr --query banana --function
|
||||
abbr --query banana --function foo
|
||||
echo $status
|
||||
# CHECKERR: abbr: --function option requires --add
|
||||
# CHECK: 2
|
||||
|
||||
abbr --query banana --function
|
||||
echo $status
|
||||
# CHECKERR: abbr: --function: option requires an argument
|
||||
# CHECKERR: checks/abbr.fish (line 141):
|
||||
# CHECKERR: abbr --query banana --function
|
||||
# CHECKERR: ^
|
||||
# CHECKERR: (Type 'help abbr' for related documentation)
|
||||
# CHECK: 2
|
||||
|
||||
abbr --add peach --function invalid/function/name
|
||||
echo $status
|
||||
# CHECKERR: abbr: Invalid function name: invalid/function/name
|
||||
@@ -160,7 +169,7 @@ abbr --add !! --position anywhere --function replace_history
|
||||
abbr --show
|
||||
# CHECK: abbr -a -- nonregex_name foo
|
||||
# CHECK: abbr -a --regex 'A[0-9]B' -- regex_name bar
|
||||
# CHECK: abbr -a --position anywhere --function -- !! replace_history
|
||||
# CHECK: abbr -a --position anywhere --function replace_history -- !!
|
||||
abbr --erase (abbr --list)
|
||||
|
||||
abbr --add bogus --position never stuff
|
||||
|
||||
Reference in New Issue
Block a user