public-inbox.git  about / heads / tags
an "archives first" approach to mailing lists
blob b86afa2ca20dccd8a6acf4d96d1f774bc4e18603 657 bytes (raw)
$ git show HEAD:contrib/completion/lei-completion.bash	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
 
# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>

# preliminary bash completion support for lei (Local Email Interface)
# Needs a lot of work, see `lei__complete' in lib/PublicInbox::LEI.pm
_lei() {
	local wordlist="$(lei _complete ${COMP_WORDS[@]})"
	wordlist="${wordlist//;/\\\\;}" # escape ';' for ';UIDVALIDITY' and such

	local word="${COMP_WORDS[COMP_CWORD]}"
	if test "$word" = ':' && test $COMP_CWORD -ge 1
	then
		COMPREPLY=($(compgen -W "$wordlist" --))
	else
		COMPREPLY=($(compgen -W "$wordlist" -- "$word"))
	fi
	return 0
}
complete -o default -o bashdefault -F _lei lei

git clone https://public-inbox.org/public-inbox.git
git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/public-inbox.git