File tree Expand file tree Collapse file tree 3 files changed +71
-0
lines changed Expand file tree Collapse file tree 3 files changed +71
-0
lines changed Original file line number Diff line number Diff line change
1
+ # ! /usr/bin/env fish
2
+
3
+ cd " $(path dirname " $(status filename)" )"
4
+
5
+ set --local src remarshal.fish
6
+ set --local dst $_ _fish_config_dir/completions/
7
+
8
+ printf ' copying "%s" to "%s"\ n' $src $dst
9
+
10
+ cp $src $dst
Original file line number Diff line number Diff line change
1
+ _remarshal () {
2
+ local cur prev opts formats input_formats output_formats
3
+
4
+ COMPREPLY=()
5
+ cur=${COMP_WORDS[COMP_CWORD]}
6
+ prev=${COMP_WORDS[COMP_CWORD - 1]}
7
+
8
+ formats=' cbor json msgpack toml yaml'
9
+ input_formats=$formats
10
+ output_formats=" $formats python"
11
+
12
+ opts=' --help --version --from --if --input-format --input --indent --stringify --max-values --output --sort-keys --to --of --output-format --unwrap --verbose --width --wrap --yaml-style'
13
+
14
+ case " ${prev} " in
15
+ --from | --if | --input-format | -f)
16
+ COMPREPLY=($( compgen -W " ${input_formats} " -- ${cur} ) )
17
+ return 0
18
+ ;;
19
+ --to | --of | --output-format | -t)
20
+ COMPREPLY=($( compgen -W " ${output_formats} " -- ${cur} ) )
21
+ return 0
22
+ ;;
23
+ --yaml-style)
24
+ COMPREPLY=($( compgen -W ' \" ' " \\ ' '|' '>'" -- ${cur} ) )
25
+ return 0
26
+ ;;
27
+ --input | -i | --output | -o)
28
+ COMPREPLY=($( compgen -f -- ${cur} ) )
29
+ return 0
30
+ ;;
31
+ * )
32
+ if [[ ${cur} == -* ]]; then
33
+ COMPREPLY=($( compgen -W " ${opts} " -- ${cur} ) )
34
+ else
35
+ COMPREPLY=($( compgen -f -- ${cur} ) )
36
+ fi
37
+ ;;
38
+ esac
39
+ }
40
+
41
+ complete -F _remarshal remarshal
Original file line number Diff line number Diff line change
1
+ complete -c remarshal -s h -l help -d " Show help message and exit"
2
+ complete -c remarshal -s v -l version -d " Show program's version number and exit"
3
+
4
+ complete -c remarshal -s f -l from -l if -l input-format -x -a " cbor json msgpack toml yaml" -d " Input format"
5
+
6
+ complete -c remarshal -s i -l input -r -d " Input file"
7
+ complete -c remarshal -s o -l output -r -d " Output file"
8
+
9
+ complete -c remarshal -s t -l to -l of -l output-format -x -a " cbor json msgpack python toml yaml" -d " Output format"
10
+
11
+ complete -c remarshal -l indent -x -d " JSON and YAML indentation"
12
+ complete -c remarshal -s k -l stringify -d " Turn special values into strings"
13
+ complete -c remarshal -l max-values -x -d " Maximum number of values in input data"
14
+ complete -c remarshal -s s -l sort -keys -d " Sort JSON, Python, and TOML keys"
15
+ complete -c remarshal -l width -x -d " Python and YAML line width"
16
+ complete -c remarshal -l yaml-style -x -a ' "\' " "\\ "" "|" ">"' -d " YAML formatting style"
17
+
18
+ complete -c remarshal -l unwrap -x -d " Only output data under given key"
19
+ complete -c remarshal -l verbose -d " Print debug information on error"
20
+ complete -c remarshal -l wrap -x -d " Wrap data in a map with given key"
You can’t perform that action at this time.
0 commit comments