mirror of
https://github.com/beetbox/beets.git
synced 2025-12-16 13:43:53 +01:00
Add warning if completion package not found
This commit is contained in:
parent
8450d51bab
commit
74cb897f79
1 changed files with 7 additions and 0 deletions
|
|
@ -1292,7 +1292,14 @@ default_commands.append(write_cmd)
|
|||
completion_cmd = ui.Subcommand('completion',
|
||||
help='print shell script that provides command line completion')
|
||||
def print_completion(*args):
|
||||
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')):
|
||||
log.warn(u'Warning: Unable to find the bash-completion package. '
|
||||
u'Command line completion might not work.')
|
||||
|
||||
for line in completion_script(default_commands):
|
||||
print(line, end='')
|
||||
|
||||
completion_cmd.func = print_completion
|
||||
default_commands.append(completion_cmd)
|
||||
|
|
|
|||
Loading…
Reference in a new issue