diff options
Diffstat (limited to 'completions/jsonschema')
-rw-r--r-- | completions/jsonschema | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/completions/jsonschema b/completions/jsonschema index 441977e4..8a36ed36 100644 --- a/completions/jsonschema +++ b/completions/jsonschema @@ -6,24 +6,25 @@ _jsonschema() _init_completion || return case $prev in - --help|--error-format|--validator|-[hFV]) + --help | --error-format | --validator | -[hFV]) return ;; - --instance|-i) + --instance | -i) _filedir json return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) + if [[ $cur == -* ]]; then + COMPREPLY=($(compgen -W '$(_parse_help "$1")' -- "$cur")) return fi - local args; _count_args "" "-*" - [[ $args -eq 1 ]] || return + local args + _count_args "" "-*" + ((args == 1)) || return _filedir '@(json|schema)' } && -complete -F _jsonschema jsonschema + complete -F _jsonschema jsonschema # ex: filetype=sh |