Skip to content

Instantly share code, notes, and snippets.

@kashewnuts
Created September 6, 2018 17:20
Show Gist options
  • Save kashewnuts/e3146c00223ab16af431e4b149569ed8 to your computer and use it in GitHub Desktop.
Save kashewnuts/e3146c00223ab16af431e4b149569ed8 to your computer and use it in GitHub Desktop.
Ubuntu18.04LTSの/usr/share/bash-completion/completions/toxで補完が効かないので修正したcompletionsファイル
# tox completion -*- shell-script -*-
_tox()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
-h|--help|--version|-n|--num|-i|--index-url|--hashseed|--force-dep)
return
;;
-c)
_filedir ini
return
;;
--installpkg|--result-json|--workdir)
_filedir
return
;;
-e)
local envs=$( "$1" --listenvs-all 2>/dev/null )
local prefix=""; [[ $cur == *,* ]] && prefix="${cur%,*},"
COMPREPLY=( $( compgen -W "$envs ALL" -- "${cur##*,}" ) )
[[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} )
return
;;
esac
$split && return
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
_filedir py
} &&
complete -F _tox tox
# ex: filetype=sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment