mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-11 15:53:37 +08:00
c39780fefb
Otherwise this would complete `git --exec-path=foo`, by running `complete -C"'' --exec-path=foo"`, which would print "--exec-path=foo", and so it would end as `git --exec-path=--exec-path=foo` because the "replaces token" bit was lost. I'm not sure how to solve it cleanly - maybe an additional option to `complete`? Anyway, for now this Fixes #9538.
33 lines
994 B
Fish
33 lines
994 B
Fish
#RUN: %fish --interactive %s
|
|
# ^ interactive so we can do `complete`
|
|
mkdir -p __fish_complete_directories/
|
|
cd __fish_complete_directories
|
|
mkdir -p test/buildroot
|
|
mkdir -p test/fish_expand_test
|
|
mkdir -p test/data/abc
|
|
mkdir -p test/data/abcd
|
|
touch test/data/af
|
|
touch test/data/abcdf
|
|
mkdir -p test/data/xy
|
|
mkdir -p test/data/xyz
|
|
touch test/data/xyf
|
|
touch test/data/xyzf
|
|
__fish_complete_directories test/z
|
|
# No match - no output!
|
|
__fish_complete_directories test/d
|
|
#CHECK: test/data/ Directory
|
|
__fish_complete_directories test/data
|
|
#CHECK: test/data/ Directory
|
|
__fish_complete_directories test/data/
|
|
#CHECK: test/data/abc/ Directory
|
|
#CHECK: test/data/abcd/ Directory
|
|
#CHECK: test/data/xy/ Directory
|
|
#CHECK: test/data/xyz/ Directory
|
|
__fish_complete_directories test/data/abc 'abc dirs'
|
|
#CHECK: test/data/abc/ abc dirs
|
|
#CHECK: test/data/abcd/ abc dirs
|
|
|
|
complete -c mydirs -l give-me-dir -a '(__fish_complete_directories)'
|
|
complete -C'mydirs --give-me-dir='
|
|
#CHECK: --give-me-dir=test/{{\t}}Directory
|