aboutsummaryrefslogtreecommitdiffstats
path: root/completions/ves.fish
diff options
context:
space:
mode:
Diffstat (limited to 'completions/ves.fish')
-rw-r--r--completions/ves.fish58
1 files changed, 58 insertions, 0 deletions
diff --git a/completions/ves.fish b/completions/ves.fish
new file mode 100644
index 0000000..7efb5ff
--- /dev/null
+++ b/completions/ves.fish
@@ -0,0 +1,58 @@
+# Tab completions for the sh-ves fish shim.
+#
+# Install this file to ~/.config/fish/completions/ves.fish (make install
+# does this automatically when fish is present).
+
+function __ves_envs
+ set -l dir
+ if set -q XDG_DATA_HOME
+ set dir $XDG_DATA_HOME/ves/envs
+ else
+ set dir $HOME/.local/share/ves/envs
+ end
+ for f in $dir/*
+ if test -f $f
+ basename $f
+ end
+ end
+end
+
+function __ves_no_subcommand
+ not __fish_seen_subcommand_from create delete copy rename activate \
+ deactivate switch run export unset show var-add var-rm list envs \
+ prompt help
+end
+
+complete -c ves -f
+
+complete -c ves -n __ves_no_subcommand -a create -d 'Create a new environment'
+complete -c ves -n __ves_no_subcommand -a delete -d 'Delete an environment'
+complete -c ves -n __ves_no_subcommand -a copy -d 'Copy an environment'
+complete -c ves -n __ves_no_subcommand -a rename -d 'Rename an environment'
+complete -c ves -n __ves_no_subcommand -a activate -d 'Activate an environment'
+complete -c ves -n __ves_no_subcommand -a deactivate -d 'Deactivate the active environment'
+complete -c ves -n __ves_no_subcommand -a switch -d 'Switch to another environment'
+complete -c ves -n __ves_no_subcommand -a run -d 'Run a command inside an environment'
+complete -c ves -n __ves_no_subcommand -a export -d 'Set a variable in an environment'
+complete -c ves -n __ves_no_subcommand -a unset -d 'Remove a variable from an environment'
+complete -c ves -n __ves_no_subcommand -a show -d 'Show the variables of an environment'
+complete -c ves -n __ves_no_subcommand -a var-add -d 'Prepend an entry to a path-like variable'
+complete -c ves -n __ves_no_subcommand -a var-rm -d 'Remove an entry from a path-like variable'
+complete -c ves -n __ves_no_subcommand -a list -d 'List the entries of a path-like variable'
+complete -c ves -n __ves_no_subcommand -a envs -d 'List all environments'
+complete -c ves -n __ves_no_subcommand -a prompt -d 'Print a prompt fragment for PS1'
+complete -c ves -n __ves_no_subcommand -a help -d 'Show usage'
+
+# subcommands taking an environment name
+complete -c ves -n '__fish_seen_subcommand_from delete activate switch show copy rename run' \
+ -a '(__ves_envs)' -d 'environment'
+
+# options
+complete -c ves -n '__fish_seen_subcommand_from create' -l override \
+ -d 'Truncate PATH, LDPATH, etc. in the new environment'
+complete -c ves -n '__fish_seen_subcommand_from export unset var-add var-rm' \
+ -l env -d 'Target environment' -xa '(__ves_envs)'
+complete -c ves -n '__fish_seen_subcommand_from var-add' -l append \
+ -d 'Append instead of prepend'
+complete -c ves -n '__fish_seen_subcommand_from list' -l index \
+ -d 'Number each entry'