Improve completion for python -m flag

This commit is contained in:
Joshua Elliott
2015-07-30 16:04:39 -06:00
parent 299a383d98
commit bc7eb39781
3 changed files with 3 additions and 3 deletions

View File

@@ -1,3 +1,3 @@
complete -c python2 -w python
# Override this to use python2 instead of python
complete -c python2 -s m -d 'Run library module as a script (terminates option list)' -xa "( find /usr/lib/(eval python2 -V 2>| sed 's/ //; s/\..\$//; s/P/p/') \$PYTHONPATH -maxdepth 1 -name '*.py' -printf '%f\n' | sed 's/.py//')"
complete -c python2 -s m -d 'Run library module as a script (terminates option list)' -xa '(python2 -c "import pkgutil; print(\'\n\'.join([p[1] for p in pkgutil.iter_modules()]))")'