File: cppman.bash

package info (click to toggle)
cppman 0.5.4%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,896 kB
  • sloc: sql: 28,371; python: 1,271; sh: 79; makefile: 14
file content (20 lines) | stat: -rw-r--r-- 400 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
_cppman ()
{
	if [ "${#COMP_WORDS[@]}" -gt 2 ]; then
		return
	fi
	if [ -z "${COMP_WORDS[1]}" ]; then
		return
	fi
	P=${COMP_LINE[0]}
	W=${COMP_WORDS[1]}

	PERLP=$(printf 'if (m/^(.*?) - (.*)$/) { print "$1$/"; }' $W)

	params="$($P -f "$W" | perl -ne "$PERLP" | sort -u | xargs -d '\n' printf '%q ')"
	echo $params > test.log

	COMPREPLY=($(compgen -W "$params" "$W"))

}
complete -F _cppman cppman