mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 21:14:19 +01:00
Add more paths to search for bash completion
This commit is contained in:
parent
8877d2a5c2
commit
151b451c33
1 changed files with 8 additions and 3 deletions
|
|
@ -1462,12 +1462,17 @@ default_commands.append(config_cmd)
|
|||
def print_completion(*args):
|
||||
for line in completion_script(default_commands + plugins.commands()):
|
||||
print(line, end='')
|
||||
if not (os.path.isfile(u'/etc/bash_completion') or
|
||||
os.path.isfile(u'/usr/share/bash-completion/bash_completion') or
|
||||
os.path.isfile(u'/usr/share/local/bash-completion/bash_completion')):
|
||||
if not any(map(os.path.isfile, BASH_COMPLETION_PATHS)):
|
||||
log.warn(u'Warning: Unable to find the bash-completion package. '
|
||||
u'Command line completion might not work.')
|
||||
|
||||
BASH_COMPLETION_PATHS = [
|
||||
u'/etc/bash_completion',
|
||||
u'/usr/share/bash-completion/bash_completion',
|
||||
u'/usr/share/local/bash-completion/bash_completion',
|
||||
u'/opt/local/share/bash-completion/bash_completion',
|
||||
]
|
||||
|
||||
|
||||
def completion_script(commands):
|
||||
"""Yield the full completion shell script as strings.
|
||||
|
|
|
|||
Loading…
Reference in a new issue