mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-29 05:03:46 +08:00
be36c96028
The description for an alias which already has escape sequences will use backslash escapes for quoting; usually `string escape` can simply quote it. Use a regex that accepts either escaping style.
23 lines
735 B
Fish
23 lines
735 B
Fish
#RUN: %fish %s
|
|
# 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"'
|
|
alias a-3='echo hello\ there'
|
|
|
|
alias foo '"a b" c d e'
|
|
# 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"'
|
|
# CHECK: alias a-3 echo\\\ hello\\\\\\\ there
|
|
# CHECK: alias foo '"a b" c d e'
|
|
# CHECK: alias my_alias 'foo; and echo foo ran'
|