mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Fix bash completion for feeds2*
This commit is contained in:
parent
3172795aa2
commit
59de496c56
@ -77,13 +77,13 @@ def options(option_parser):
|
|||||||
return opts
|
return opts
|
||||||
|
|
||||||
def opts_and_words(name, op, words):
|
def opts_and_words(name, op, words):
|
||||||
opts = ' '.join(options(op))
|
opts = '|'.join(options(op))
|
||||||
words = [repr(w) for w in words]
|
words = '|'.join([w.replace("'", "\\'") for w in words])
|
||||||
words = ' '.join(words)
|
|
||||||
return '_'+name+'()'+\
|
return '_'+name+'()'+\
|
||||||
'''
|
'''
|
||||||
{
|
{
|
||||||
local cur prev opts
|
local cur prev opts
|
||||||
|
local IFS=$'|\\t'
|
||||||
COMPREPLY=()
|
COMPREPLY=()
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
opts="%s"
|
opts="%s"
|
||||||
@ -92,10 +92,12 @@ def opts_and_words(name, op, words):
|
|||||||
case "${cur}" in
|
case "${cur}" in
|
||||||
-* )
|
-* )
|
||||||
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
||||||
|
COMPREPLY=( $( echo ${COMPREPLY[@]} | sed 's/ /\\\\ /g' | tr '\\n' '\\t' ) )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
COMPREPLY=( $(compgen -W "${words}" -- ${cur}) )
|
COMPREPLY=( $(compgen -W "${words}" -- ${cur}) )
|
||||||
|
COMPREPLY=( $( echo ${COMPREPLY[@]} | sed 's/ /\\\\ /g' | tr '\\n' '\\t' ) )
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
x
Reference in New Issue
Block a user