Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fish shell completion to be compatible with macOS #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions vex/shell_configs/fish
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ end

function __vex_list_virtualenvs
# echo the names of virtualenvs available as 'vex VENVNAME'.
set dirs (find "$WORKON_HOME" -maxdepth 2 -name "bin" -type d -not -empty -printf '%h\n')
set dirs (find "$WORKON_HOME" -maxdepth 2 -name "bin" -type d -not -empty | xargs -n 1 dirname)
for NAME in $dirs
basename $NAME
end
Expand All @@ -52,7 +52,7 @@ function __vex_list_commands
if [ (count $cmd) -eq 2 -a $cmd[1] = 'vex' ]
set ve "$WORKON_HOME/$cmd[2]"
if test -f "$ve/bin"
find "$ve/bin" -maxdepth 1 -executable -printf '%f\n'
find "$ve/bin" -maxdepth 1 -executable | xargs basename
end
end
set -l ctoken (commandline -ct)
Expand All @@ -62,7 +62,7 @@ end
# If we source this, we want to wipe out previously defined vex completions
complete -e -c vex
# Two positional arguments, a virtualenv and a command.
complete -c vex -n "__vex_needs_virtualenv" -d "Virtualenv" -f -a "(__vex_list_virtualenvs)"
complete -c vex -n "__vex_needs_virtualenv" -d "Virtualenv" -f -a "(__vex_list_virtualenvs)"
complete -c vex -n "__vex_needs_command" -d "Command from Virtualenv" -x -a "(__vex_list_commands)"
# Other options.
complete -c vex -l help -s h -n "__fish_no_arguments" -d "print help information"
Expand Down