fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Klaus HippFix completion typos5c25d3c3b

master
3.0 KiB43 linesraw
1# This function adjusts for options with arguments (-X, -W, etc.), ensures completions stop when a script/module is set (-c, -m, file, -)
2function __fish_python_no_arg
3    set -l num 1
4    set -l tokens (commandline -pxc)
5    set -l has_arg_list -X -W --check-hash-based-pycs
6    if contains -- - $tokens
7        set num (math $num - 1)
8    end
9    for has_arg in $has_arg_list
10        if contains -- $has_arg $tokens
11            set num (math $num + 1)
12        end
13    end
14    if test (__fish_number_of_cmd_args_wo_opts) -gt $num
15        return 1
16    end
17    return 0
18end
19
20complete -c python3 -n __fish_python_no_arg -s B -d 'Don\'t write .py[co] files on import'
21complete -c python3 -n __fish_python_no_arg -s c -x -d "Execute argument as command"
22complete -c python3 -n __fish_python_no_arg -s d -d "Debug on"
23complete -c python3 -n __fish_python_no_arg -s E -d "Ignore environment variables"
24complete -c python3 -n __fish_python_no_arg -s h -s '?' -l help -d "Display help and exit"
25complete -c python3 -n __fish_python_no_arg -s i -d "Interactive mode after executing commands"
26complete -c python3 -n __fish_python_no_arg -s O -d "Enable optimizations"
27complete -c python3 -n __fish_python_no_arg -o OO -d "Remove doc-strings in addition to the -O optimizations"
28complete -c python3 -n __fish_python_no_arg -s s -d 'Don\'t add user site directory to sys.path'
29complete -c python3 -n __fish_python_no_arg -s S -d "Disable import of site module"
30complete -c python3 -n __fish_python_no_arg -s u -d "Unbuffered input and output"
31complete -c python3 -n __fish_python_no_arg -s v -d "Verbose mode"
32complete -c python3 -n __fish_python_no_arg -s V -l version -d "Display version and exit"
33complete -c python3 -n __fish_python_no_arg -s W -x -d "Warning control" -a "ignore default all module once error"
34complete -c python3 -n __fish_python_no_arg -s x -d 'Skip first line of source, allowing use of non-Unix forms of #!cmd'
35complete -c python3 -n __fish_python_no_arg -k -fa "(__fish_complete_suffix .py)"
36complete -c python3 -n __fish_python_no_arg -fa - -d 'Read program from stdin'
37complete -c python3 -n __fish_python_no_arg -s q -d 'Don\'t print version and copyright messages on interactive startup'
38complete -c python3 -n __fish_python_no_arg -s X -x -d 'Set implementation-specific option' -a 'faulthandler showrefcount tracemalloc showalloccount importtime dev utf8 pycache_prefix=PATH:'
39complete -c python3 -n __fish_python_no_arg -s b -d 'Issue warnings for possible misuse of `bytes` with `str`'
40complete -c python3 -n __fish_python_no_arg -o bb -d 'Issue errors for possible misuse of `bytes` with `str`'
41complete -c python3 -n __fish_python_no_arg -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()]))")'
42complete -c python3 -n __fish_python_no_arg -l check-hash-based-pycs -d 'Set pyc hash check mode' -xa "default always never"
43complete -c python3 -n __fish_python_no_arg -s I -d 'Run in isolated mode'