|
| 1 | +#compdef _quick-lint-js quick-lint-js |
| 2 | + |
| 3 | +# Copyright (C) 2020 Matthew Glazar |
| 4 | +# See end of file for extended copyright information. |
| 5 | + |
| 6 | +# This script is used to provide command line completion for |
| 7 | +# quick-lint-js when using zsh shell |
| 8 | + |
| 9 | +typeset -A opt_args |
| 10 | + |
| 11 | +function _quick-lint-js() { |
| 12 | + local curcontext="$curcontext" state line |
| 13 | + local -i ret=1 |
| 14 | + local -a args |
| 15 | + |
| 16 | + args+=( |
| 17 | + '(- *)'--help'[Print help message]' |
| 18 | + '(- *)'--version'[Print version information]' |
| 19 | + '(--lsp-server)*:file:_files' |
| 20 | + '(--exit-fail-on --output-format *)'--lsp-server'[Run quick-lint-js in LSP server mode]' |
| 21 | + '(--lsp-server)--exit-fail-on=[Fail with a non-zero exit code if any of these errors are found (default\: "all")]' |
| 22 | + '(--lsp-server)--output-format=[Format to print feedback where FORMAT is one of\: gnu-like (default if omitted), vim-qflist-json]:format:->format' |
| 23 | + '--vim-file-bufnr=[Select a vim buffer for outputting feedback]') |
| 24 | + |
| 25 | + _arguments -C -S "${args[@]}" && ret=0 |
| 26 | + |
| 27 | + case "$state" in |
| 28 | + format) |
| 29 | + formats=( 'vim-qflist-json' 'gnu-like' ) |
| 30 | + _describe 'format' formats && ret=0 |
| 31 | + ;; |
| 32 | + esac |
| 33 | + return ret |
| 34 | +} |
| 35 | + |
| 36 | +# quick-lint-js finds bugs in JavaScript programs. |
| 37 | +# Copyright (C) 2020 Matthew Glazar |
| 38 | +# |
| 39 | +# This file is part of quick-lint-js. |
| 40 | +# |
| 41 | +# quick-lint-js is free software: you can redistribute it and/or modify |
| 42 | +# it under the terms of the GNU General Public License as published by |
| 43 | +# the Free Software Foundation, either version 3 of the License, or |
| 44 | +# (at your option) any later version. |
| 45 | +# |
| 46 | +# quick-lint-js is distributed in the hope that it will be useful, |
| 47 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 48 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 49 | +# GNU General Public License for more details. |
| 50 | +# |
| 51 | +# You should have received a copy of the GNU General Public License |
| 52 | +# along with quick-lint-js. If not, see <https://www.gnu.org/licenses/>. |
0 commit comments