1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
_have black &&
_black()
{
local cur prev
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in
-l|--line-length|--include|--exclude|--python-cell-magics|--required-version|--extend-exclude|--force-exclude|-W|--workers)
return 0;;
-t|--target-version)
COMPREPLY=( $(compgen -W "py33 py34 py35 py36 py37 py38 py39 py310 py311 py312" -- $cur) )
return;;
esac
if [[ "$cur" == -* ]]; then
opts='-c -l -t -S -C -W -q -v -h'
lopts='
--code
--line-length
--pypi
--ipynb
--python-cell-magics
--skip-string-normalization
--skip-magic-trailing-comma
--preview
--check
--diff
--color
--no-color
--fast
--safe
--required-version
--include
--exclude
--extend-exclude
--force-exclude
--stdin-filename
--workers
--quiet
--verbose
--version
--config
'
COMPREPLY=( $(compgen -W "${opts[*]} ${lopts[*]}" -- $cur) )
else
_filedir
fi
}
complete -F _black $filenames black
|