fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes Altmanningeralias: fix indentation096f22557

master
1.7 KiB49 linesraw
1#RUN: %fish %s
2# Avoid regressions of issue \#3860 wherein the first word of the alias ends with a semicolon
3function foo
4    echo ran foo
5end
6alias my_alias "foo; and echo foo ran"
7my_alias
8# CHECK: ran foo
9# CHECK: foo ran
10
11alias a-2='echo "hello there"'
12alias a-3='echo hello\ there'
13
14alias foo '"a b" c d e'
15# Bare `alias` should list the aliases we have created and nothing else
16# We have to exclude two aliases because they're an artifact of the unit test
17# framework and we can't predict the definition.
18alias | grep -Ev '^alias (fish_indent|fish_key_reader) '
19# CHECK: alias a-2 'echo "hello there"'
20# CHECK: alias a-3 'echo hello\\\\ there'
21# CHECK: alias foo '"a b" c d e'
22# CHECK: alias my_alias 'foo; and echo foo ran'
23
24# #4756 - missing "--" argument to string causing issues with "--" options
25alias l. "ls -d .*"
26# No output
27
28alias d "'/mnt/c/Program Files (x86)/devenv.exe' /Edit"
29functions d | sed s,^,^,
30# CHECK: ^# Defined via `source`
31# CHECK: ^function d --wraps="'/mnt/c/Program Files (x86)/devenv.exe' /Edit" --description "alias d '/mnt/c/Program Files (x86)/devenv.exe' /Edit"
32# CHECK: ^    '/mnt/c/Program Files (x86)/devenv.exe' /Edit $argv
33# CHECK: ^end
34
35# Use "command" to prevent recursion, and don't add --wraps to avoid accidental recursion in completion.
36alias e 'e --option=value'
37functions e
38# CHECK: # Defined via `source`
39# CHECK: function e --description 'alias e e --option=value'
40# CHECK: command e --option=value $argv
41# CHECK: end
42
43# Don't add --wraps if it looks like a wrapper command to avoid accidental recursion in completion.
44alias f 'wrapper around f'
45functions f
46# CHECK: # Defined via `source`
47# CHECK: function f --description 'alias f wrapper around f'
48# CHECK: wrapper around f $argv
49# CHECK: end