mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 17:55:27 +00:00
Add basic bash completion
This commit is contained in:
parent
7ab2c9dcc1
commit
dcd9fbfaf9
23
legendary/bash/legendary
Normal file
23
legendary/bash/legendary
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
|
||||||
|
_cmds()
|
||||||
|
{
|
||||||
|
local cur prev
|
||||||
|
COMPREPLY=()
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
|
if [[ ${cur} == * ]] ; then
|
||||||
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add main commands
|
||||||
|
opts=$(legendary --help | grep "{*}" | tr '{|}|,' ' ' | head --lines=1)
|
||||||
|
opts=${opts##*( )}
|
||||||
|
|
||||||
|
# Add dashed commands
|
||||||
|
opts="$opts $(legendary --help | grep "\-\-" | awk '{ printf $1 " " $2 "\n" }' | tr '\n|,' ' ')"
|
||||||
|
|
||||||
|
|
||||||
|
complete -F _cmds legendary
|
2
setup.py
2
setup.py
|
@ -38,6 +38,8 @@ setup(
|
||||||
'setuptools',
|
'setuptools',
|
||||||
'wheel'
|
'wheel'
|
||||||
],
|
],
|
||||||
|
data_files=[
|
||||||
|
('/etc/bash_completion.d/', ['legendary/bash/legendary'])],
|
||||||
url='https://github.com/derrod/legendary',
|
url='https://github.com/derrod/legendary',
|
||||||
description='Free and open-source replacement for the Epic Games Launcher application',
|
description='Free and open-source replacement for the Epic Games Launcher application',
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
|
|
Loading…
Reference in a new issue