fork/fish-shell

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

Jinser Kafkacompletions/guile: update against guile/guild 3.0.11bacdcbc65

master
2.1 KiB72 linesraw
1function __fish_guild__complete_warnings
2    guild compile -Whelp |
3        string replace --filter --regex '^\s+`([a-z\-]+)\'\s+(.+)' '$1\t$2'
4
5    printf '%s\n' 0 2 3
6    echo 1\tdefault
7end
8
9function __fish_guild__complete_optimizations
10    guild compile -Ohelp |
11        string replace --filter --regex '^\s+-O(.+)' '$1\nno-$1'
12
13    printf '%s\n' 0 1 3
14    echo 2\tdefault
15end
16
17set -l command guild
18complete -c $command -f
19
20set -l compile_condition '__fish_seen_subcommand_from compile'
21
22# compile takes FILE... as positional arguments
23complete -c $command -F -n $compile_condition
24
25complete -c $command -a 'compile\tCompile scripts' -n "not $compile_condition"
26
27complete -c $command -s h -l help -d 'Show help' -n $compile_condition
28complete -c $command -l version -d 'Show version' -n $compile_condition
29
30complete -c $command -s L -l load-path -F \
31    -d 'Specify the directory to prepend to module load path' \
32    -n $compile_condition
33
34complete -c $command -s o -l output -F \
35    -d 'Specify the output file to put bytecode in' \
36    -n $compile_condition
37
38complete -c $command -s x -x \
39    -d 'Specify the extension to prepend to extension list' \
40    -n $compile_condition
41
42complete -c $command -s W -l warning \
43    -a "(__fish_stripprefix='^(--warning=|-\w*W)' __fish_complete_list , __fish_guild__complete_warnings)" \
44    -d 'Specify the warning level for a compilation' \
45    -n $compile_condition
46
47complete -c $command -s O -l optimize \
48    -a '(__fish_guild__complete_optimizations)' \
49    -d 'Specify the optimization level for a compilation' \
50    -n $compile_condition
51
52for standard in 6 7
53    set -l option r$standard"rs"
54
55    complete -c $command -l $option \
56        -d "Use $(string upper -- $option) compatible mode" \
57        -n $compile_condition
58end
59
60complete -c $command -s f -l from \
61    -a 'scheme\tdefault elisp ecmascript' \
62    -d 'Specify the language for sources' \
63    -n $compile_condition
64
65complete -c $command -s t -l to \
66    -a 'bytecode\tdefault tree-il cps value' \
67    -d 'Specify the language for an output' \
68    -n $compile_condition
69
70complete -c $command -s T -l target \
71    -d 'Specify the target for a code' \
72    -n $compile_condition