mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 22:14:53 +00:00
vagrant completions: use __fish_parent_directories
This commit is contained in:
parent
177cfbc605
commit
7c1b68516d
1 changed files with 2 additions and 11 deletions
|
@ -16,18 +16,9 @@ set -l plugin_commands install license list uninstall update
|
||||||
set -l snapshot_commands delete list pop push restore save
|
set -l snapshot_commands delete list pop push restore save
|
||||||
|
|
||||||
function __fish_print_vagrant_state
|
function __fish_print_vagrant_state
|
||||||
# Find a .vagrant file/directory above $PWD
|
for dir in (__fish_parent_directories $PWD)
|
||||||
set -l root
|
string match '*/.vagrant' $dir && break
|
||||||
set -l dir (pwd -P)
|
|
||||||
while test $dir != /
|
|
||||||
if test -d $dir.vagrant -o -f $dir.vagrant
|
|
||||||
echo $dir.vagrant
|
|
||||||
return 0
|
|
||||||
end
|
|
||||||
# Go up one directory
|
|
||||||
set dir (string replace -r '[^/]*/?$' '' $dir)
|
|
||||||
end
|
end
|
||||||
return 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function __fish_vagrant_machines
|
function __fish_vagrant_machines
|
||||||
|
|
Loading…
Reference in a new issue