Skip to content

Commit

Permalink
feat(compl): update completions
Browse files Browse the repository at this point in the history
  • Loading branch information
dbohdan committed Jan 17, 2025
1 parent a4560cd commit 5913d19
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ $ remarshal test.toml --of json --unwrap main
[{"a":"b"},{"c":[1,2,3]}]
```

## Shell completions

Remarshal provides shell-completion files for Bash and fish in the directory [`completions/`](completions/).
You can install fish completions automatically by running `install.fish`.
You will need to install Bash completions manually.

## Examples

### TOML to YAML
Expand Down
2 changes: 1 addition & 1 deletion completions/remarshal.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _remarshal() {
input_formats=$formats
output_formats="$formats python"

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'
opts='--help --version --from --if --input-format --input --indent --stringify --max-values --multiline --output --sort-keys --to --of --output-format --unwrap --verbose --width --wrap --yaml-style'

case "${prev}" in
--from | --if | --input-format | -f)
Expand Down
1 change: 1 addition & 0 deletions completions/remarshal.fish
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ complete -c remarshal -s t -l to -l of -l output-format -x -a "cbor json msgpack
complete -c remarshal -l indent -x -d "JSON and YAML indentation"
complete -c remarshal -s k -l stringify -d "Turn special values into strings"
complete -c remarshal -l max-values -x -d "Maximum number of values in input data"
complete -c remarshal -l multiline -x -d "Minimum items for multiline TOML array"
complete -c remarshal -s s -l sort-keys -d "Sort JSON, Python, and TOML keys"
complete -c remarshal -l width -x -d "Python and YAML line width"
complete -c remarshal -l yaml-style -x -a '"\'" "\\"" "|" ">"' -d "YAML formatting style"
Expand Down

0 comments on commit 5913d19

Please sign in to comment.