Fix python{,2,3} argument completions

Only the first non-switch parameter to python must be a .py file, but
everything thereafter is "just another argument". This enables file
completions for 2nd+ arguments.
This commit is contained in:
Mahmoud Al-Qudsi
2018-05-12 23:40:40 -05:00
parent 5f1168002e
commit 20395339a4
3 changed files with 6 additions and 6 deletions

View File

@@ -13,8 +13,8 @@ complete -c python3 -s v -d "Verbose mode"
complete -c python3 -s V -d "Display version and exit"
complete -c python3 -s W -x -d "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 -fa "(__fish_complete_suffix .py)"
complete -c python3 -fa '-' -d 'Read program from stdin'
complete -c python3 -n '__fish_is_first_token' -fa "(__fish_complete_suffix .py)"
complete -c python3 -f -n '__fish_is_first_token' -a '-' -d 'Read program from stdin'
complete -c python3 -s q -d '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'