blob: 7efb5ff0814d86051f7a2ee22306d6486edb7628 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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'
|