Skip to content

Commit

Permalink
Update scripts/register-python-argcomplete
Browse files Browse the repository at this point in the history
Not tested or anything.
  • Loading branch information
rupa committed Nov 24, 2012
1 parent 4b8ac63 commit 6183a63
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions scripts/register-python-argcomplete
Expand Up @@ -10,23 +10,13 @@ Example:
$ eval "$(register-python-argcomplete my-favorite-script.py)"
'''

# TODO: figure out how to get rid of IFS substitution

shellcode = '''
_python_argcomplete() {
if [[ ${!IFS[@]} ]]; then
ARGCOMPLETE_IFS_TEMP=$IFS
fi
IFS='\013'
local IFS='\013'
COMPREPLY=( $(IFS="$IFS" COMP_LINE="$COMP_LINE" COMP_POINT="$COMP_POINT" _ARGCOMPLETE=1 $1) )
if [[ $? != 0 ]]; then
unset COMPREPLY
fi
if [[ ${!ARGCOMPLETE_IFS_TEMP[@]} ]]; then
IFS=$ARGCOMPLETE_IFS_TEMP
unset ARGCOMPLETE_IFS_TEMP
fi
}
complete -o nospace -o default -F _python_argcomplete %s
'''
Expand Down

0 comments on commit 6183a63

Please sign in to comment.