aboutsummaryrefslogtreecommitdiffstats
path: root/completions/sail.fish
blob: e6404a75eabb57c9bf017779f414cd1273ed2626 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
complete -c sail -n 'not __sailfish_has_options' -rs a -l add -d 'Add a jump for the current directory'
complete -c sail -n 'not __sailfish_has_options' -s e -l edit -d 'Edit the jump file'
complete -c sail -n 'not __sailfish_has_options' -s p -l print -d 'Print the jump file'

complete -x -c sail -a "(__sailfish_suggest)"

function __sailfish_suggest
	set -l jumps (__sailfish_print_jumpfile)

	test -r $jumps; or return 1

	set -l cmd (commandline -co)
	test (count $cmd) -gt 1; and return 1

	cat $jumps
end

function __sailfish_has_options
	__fish_contains_opt -s a add -s e edit -s p print
end