OXYGENHUB
◆ main openmsx / Contrib / openmsx-complete.bash
574 B · Bourne Again Shell (bash) · last changed chore(): initial commit 1 month ago source blame history raw
1
# This file enables openmsx specific tab-completion in the bash shell.
2
#
3
# To enable it system-wide, copy and rename this file to
4
#    /etc/bash_completion.d/openmsx
5
# To enable it only for the current user, source this file from e.g. your
6
#    ~/.bashrc
7
# file.
8
#
9
# This needs an openMSX version newer than openmsx-0.9.1 (TODO replace with
10
# actual version number once that number is known).
11
12
_openmsx_complete()
13
{
14
	local cur tmp
15
	cur=${COMP_WORDS[COMP_CWORD]}
16
	tmp=$(openmsx -bash $3)
17
	COMPREPLY=($(compgen -W '$tmp' -- "$cur"))
18
}
19
complete -f -F _openmsx_complete openmsx