2024-04-12 18:19:32 +08:00
|
|
|
#RUN: %fish %s
|
2019-06-27 03:02:14 +08:00
|
|
|
# Avoid regressions of issue \#3860 wherein the first word of the alias ends with a semicolon
|
|
|
|
function foo
|
|
|
|
echo ran foo
|
|
|
|
end
|
|
|
|
alias my_alias "foo; and echo foo ran"
|
|
|
|
my_alias
|
|
|
|
# CHECK: ran foo
|
|
|
|
# CHECK: foo ran
|
|
|
|
|
|
|
|
alias a-2='echo "hello there"'
|
2020-04-18 15:35:33 +08:00
|
|
|
alias a-3='echo hello\ there'
|
2019-06-27 03:02:14 +08:00
|
|
|
|
2019-11-30 03:09:02 +08:00
|
|
|
alias foo '"a b" c d e'
|
2019-06-27 03:02:14 +08:00
|
|
|
# Bare `alias` should list the aliases we have created and nothing else
|
|
|
|
# We have to exclude two aliases because they're an artifact of the unit test
|
|
|
|
# framework and we can't predict the definition.
|
|
|
|
alias | grep -Ev '^alias (fish_indent|fish_key_reader) '
|
|
|
|
# CHECK: alias a-2 'echo "hello there"'
|
2024-04-13 07:00:44 +08:00
|
|
|
# CHECK: alias a-3 'echo hello\\\\ there'
|
2019-11-30 03:09:02 +08:00
|
|
|
# CHECK: alias foo '"a b" c d e'
|
2019-06-27 03:02:14 +08:00
|
|
|
# CHECK: alias my_alias 'foo; and echo foo ran'
|
2020-07-15 03:08:47 +08:00
|
|
|
|
|
|
|
# #4756 - missing "--" argument to string causing issues with "--" options
|
|
|
|
alias l. "ls -d .*"
|
|
|
|
# No output
|
2020-07-27 23:18:51 +08:00
|
|
|
|
|
|
|
alias d "'/mnt/c/Program Files (x86)/devenv.exe' /Edit"
|
|
|
|
functions d
|
2020-12-12 06:05:22 +08:00
|
|
|
# CHECK: # Defined via `source`
|
2024-04-13 07:00:44 +08:00
|
|
|
# CHECK: function d --wraps="'/mnt/c/Program Files (x86)/devenv.exe' /Edit" --description "alias d '/mnt/c/Program Files (x86)/devenv.exe' /Edit"
|
2022-09-11 15:55:11 +08:00
|
|
|
# CHECK: '/mnt/c/Program Files (x86)/devenv.exe' /Edit $argv
|
2020-07-27 23:18:51 +08:00
|
|
|
# CHECK: end
|
2020-10-10 15:08:58 +08:00
|
|
|
|
|
|
|
# Use "command" to prevent recusion, and don't add --wraps to avoid accidental recursion in completion.
|
|
|
|
alias e 'e --option=value'
|
|
|
|
functions e
|
2020-12-12 06:05:22 +08:00
|
|
|
# CHECK: # Defined via `source`
|
2020-10-10 15:08:58 +08:00
|
|
|
# CHECK: function e --description 'alias e e --option=value'
|
2022-09-11 15:55:11 +08:00
|
|
|
# CHECK: command e --option=value $argv
|
2020-10-10 15:08:58 +08:00
|
|
|
# CHECK: end
|
|
|
|
|
|
|
|
# Don't add --wraps if it looks like a wrapper command to avoid accidental recursion in completion.
|
|
|
|
alias f 'wrapper around f'
|
|
|
|
functions f
|
2020-12-12 06:05:22 +08:00
|
|
|
# CHECK: # Defined via `source`
|
2020-10-10 15:08:58 +08:00
|
|
|
# CHECK: function f --description 'alias f wrapper around f'
|
2022-09-11 15:55:11 +08:00
|
|
|
# CHECK: wrapper around f $argv
|
2020-10-10 15:08:58 +08:00
|
|
|
# CHECK: end
|