# bash completion for 2to3 -*- shell-script -*- proc _2to3 { local cur prev words cword split _init_completion -s || return match $prev { with -h|--help|--add-suffix return with -f|--fix|-x|--nofix setglobal COMPREPLY = ''( $( compgen -W \ "$( $1 --list-fixes 2>/dev/null | sed -e 1d )" -- "$cur" ) ) return with -j|--processes setglobal COMPREPLY = ''( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) return with -o|--output-dir _filedir -d return } $split && return if [[ $cur == -* ]] { setglobal COMPREPLY = ''( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace return } _filedir py } && complete -F _2to3 2to3 # ex: ts=4 sw=4 et filetype=sh