mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 12:23:09 +00:00
Add a new completion test for optional arguments
This commit is contained in:
parent
96157a05f6
commit
dce9453d25
2 changed files with 7 additions and 0 deletions
|
@ -67,6 +67,11 @@ echo "Expect -AQ -AW:" (complete -C'TestExclusive -A' | sort | string join ' ')
|
|||
echo "Expect no output 1:" (complete -C'TestExclusive -Q')
|
||||
echo "Expect no output 2:" (complete -C'TestExclusive -W')
|
||||
|
||||
# Test for optional arguments, like cp's --backup
|
||||
complete -c TestOptionalArgument -l backup -f -a 'none all simple'
|
||||
echo "Expect --backup --backup=:" (complete -C'TestOptionalArgument -' | sort | string join ' ')
|
||||
echo "Expect --backup=all --backup=none --backup=simple:" (complete -C'TestOptionalArgument --backup=' | sort | string join ' ')
|
||||
|
||||
# Test that directory completions work correctly
|
||||
if begin; rm -rf test6.tmp.dir; and mkdir test6.tmp.dir; end
|
||||
pushd test6.tmp.dir
|
||||
|
|
|
@ -38,6 +38,8 @@ Expect -A -Q -W: -A -Q -W
|
|||
Expect -AQ -AW: -AQ -AW
|
||||
Expect no output 1:
|
||||
Expect no output 2:
|
||||
Expect --backup --backup=: --backup --backup=
|
||||
Expect --backup=all --backup=none --backup=simple: --backup=all --backup=none --backup=simple
|
||||
implicit cd complete works
|
||||
no implicit cd complete after 'command'
|
||||
PATH does not cause incorrect implicit cd
|
||||
|
|
Loading…
Reference in a new issue