forked from fish-shell/fish-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The issue here was that the `python` completion did a version check on the `python` binary, so it would complete python2 stuff if system python was py2, even if the user tried to complete `python3`. This isn't beautiful, but it's more resilient than e.g. doing magic with `commandline`. Fixes fish-shell#3840.
- Loading branch information
Showing
2 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
complete -c python2 -w python | ||
complete -c python2 -s B --description 'Don\'t write .py[co] files on import' | ||
complete -c python2 -s c -x --description "Execute argument as command" | ||
complete -c python2 -s d --description "Debug on" | ||
complete -c python2 -s E --description "Ignore environment variables" | ||
complete -c python2 -s h -l help --description "Display help and exit" | ||
complete -c python2 -s i --description "Interactive mode after executing commands" | ||
complete -c python2 -s O --description "Enable optimizations" | ||
complete -c python2 -o OO --description "Remove doc-strings in addition to the -O optimizations" | ||
complete -c python2 -s s --description 'Don\'t add user site directory to sys.path' | ||
complete -c python2 -s S --description "Disable import of site module" | ||
complete -c python2 -s u --description "Unbuffered input and output" | ||
complete -c python2 -s v --description "Verbose mode" | ||
complete -c python2 -s V --description "Display version and exit" | ||
complete -c python2 -s W -x --description "Warning control" -a "ignore default all module once error" | ||
complete -c python2 -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd' | ||
complete -c python2 -a "(__fish_complete_suffix .py)" | ||
complete -c python2 -a '-' -d 'Read program from stdin' | ||
complete -c python2 -s 3 -d 'Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix' | ||
complete -c python2 -s t --description "Warn on mixed tabs and spaces" | ||
complete -c python2 -s Q -x -a "old new warn warnall" --description "Division control" | ||
# Override this to use python2 instead of python | ||
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()]))")' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
complete -c python3 -w python | ||
# Override this to use python2 instead of python | ||
complete -c python3 -s B --description 'Don\'t write .py[co] files on import' | ||
complete -c python3 -s c -x --description "Execute argument as command" | ||
complete -c python3 -s d --description "Debug on" | ||
complete -c python3 -s E --description "Ignore environment variables" | ||
complete -c python3 -s h -l help --description "Display help and exit" | ||
complete -c python3 -s i --description "Interactive mode after executing commands" | ||
complete -c python3 -s O --description "Enable optimizations" | ||
complete -c python3 -o OO --description "Remove doc-strings in addition to the -O optimizations" | ||
complete -c python3 -s s --description 'Don\'t add user site directory to sys.path' | ||
complete -c python3 -s S --description "Disable import of site module" | ||
complete -c python3 -s u --description "Unbuffered input and output" | ||
complete -c python3 -s v --description "Verbose mode" | ||
complete -c python3 -s V --description "Display version and exit" | ||
complete -c python3 -s W -x --description "Warning control" -a "ignore default all module once error" | ||
complete -c python3 -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd' | ||
complete -c python3 -a "(__fish_complete_suffix .py)" | ||
complete -c python3 -a '-' -d 'Read program from stdin' | ||
complete -c python3 -s q --description 'Don\'t print version and copyright messages on interactive startup' | ||
complete -c python3 -s X -x -d 'Set implementation-specific option' | ||
complete -c python3 -s b -d 'Issue warnings about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str' | ||
complete -c python3 -o bb -d 'Issue errors' | ||
complete -c python3 -s m -d 'Run library module as a script (terminates option list)' -xa '(python3 -c "import pkgutil; print(\'\n\'.join([p[1] for p in pkgutil.iter_modules()]))")' | ||
|