mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-05 04:17:51 +00:00
Bash completions
This commit is contained in:
parent
956c5b7181
commit
ad85f3d023
5
Vagrantfile
vendored
5
Vagrantfile
vendored
@ -21,7 +21,7 @@ Vagrant.configure(2) do |config|
|
||||
config.vm.provision :shell, privileged: true, inline: <<-EOF
|
||||
apt-get install -qq -o=Dpkg::Use-Pty=0 -y \
|
||||
git cmake curl attr pkg-config libgit2-dev \
|
||||
fish
|
||||
fish zsh bash bash-completion
|
||||
EOF
|
||||
|
||||
|
||||
@ -63,6 +63,9 @@ Vagrant.configure(2) do |config|
|
||||
|
||||
# Link the completion files so they’re “installed”.
|
||||
config.vm.provision :shell, privileged: true, inline: <<-EOF
|
||||
test -h /etc/bash_completion.d/exa \
|
||||
|| ln -s /vagrant/contrib/completions.bash /etc/bash_completion.d/exa
|
||||
|
||||
test -h /usr/share/zsh/vendor-completions/_exa \
|
||||
|| ln -s /vagrant/contrib/completions.zsh /usr/share/zsh/vendor-completions/_exa
|
||||
|
||||
|
37
contrib/completions.bash
Normal file
37
contrib/completions.bash
Normal file
@ -0,0 +1,37 @@
|
||||
_exa()
|
||||
{
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
case "$prev" in
|
||||
-'?'|--help|-v|--version)
|
||||
return
|
||||
;;
|
||||
|
||||
-L|--level)
|
||||
COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) )
|
||||
return
|
||||
;;
|
||||
|
||||
-s|--sort)
|
||||
COMPREPLY=( $( compgen -W 'name filename Name Filename size filesize extension Extension modified accessed created none inode --' -- "$cur" ) )
|
||||
return
|
||||
;;
|
||||
|
||||
-t|--time)
|
||||
COMPREPLY=( $( compgen -W 'accessed modified created --' -- $cur ) )
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
||||
;;
|
||||
|
||||
*)
|
||||
_filedir
|
||||
;;
|
||||
esac
|
||||
} &&
|
||||
complete -o filenames -o bashdefault -F _exa exa
|
Loading…
Reference in New Issue
Block a user