aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_complete_command.fish
blob: 983366db66861d02e85b8e4d28a92738c4ac7216 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function __fish_complete_command --description 'Complete using all available commands'
	set -l ctoken (commandline -ct)
	switch $ctoken
	case '*=*'
        # Some seds (e.g. on Mac OS X), don't support \n in the RHS
        # Use a literal newline instead
        # http://sed.sourceforge.net/sedfaq4.html#s4.1
		set ctoken (echo $ctoken  | sed 's/=/\\
/')
		printf '%s\n' $ctoken[1]=(complete -C$ctoken[2])
	case '*'
		complete -C$ctoken
	end
end