Skip to content

Commit bf90a3b

Browse files
committed
Add --config-file to --help and shell completions
1 parent 0845021 commit bf90a3b

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

completions/_quick-lint-js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ function _quick-lint-js() {
1717
'(- *)'--help'[Print help message]'
1818
'(- *)'--version'[Print version information]'
1919
'(--lsp-server)*:file:_files'
20-
'(--stdin --exit-fail-on --output-format *)'--lsp-server'[Run quick-lint-js in LSP server mode]'
20+
'(--config-file --stdin --exit-fail-on --output-format *)'--lsp-server'[Run quick-lint-js in LSP server mode]'
21+
'(--lsp-server)--config-file=[Read configuration from a JSON file for later input files]:file:_files'
2122
'(--lsp-server)--stdin[Read standard input as a JavaScript file]'
2223
'(--lsp-server)--exit-fail-on=[Fail with a non-zero exit code if any of these errors are found (default\: "all")]'
2324
'(--lsp-server)--output-format=[Format to print feedback where FORMAT is one of\: gnu-like (default if omitted), vim-qflist-json]:format:->format'

completions/quick-lint-js.bash

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ _quick-lint-js () {
55
local cur opts
66
_init_completion -n = || return
77

8-
opts='--help --version --lsp-server --stdin --exit-fail-on= --output-format= --vim-file-bufnr='
8+
opts='--help --version --lsp-server --config-file= --stdin --exit-fail-on= --output-format= --vim-file-bufnr='
99

1010
case $cur in
11+
--config-file=*)
12+
_split_longopt
13+
_filedir
14+
return
15+
;;
1116
--output-format=*)
1217
COMPREPLY=($(compgen -W 'gnu-like vim-qflint-json' -- "${cur#*=}"))
1318
return

completions/quick-lint-js.fish

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
complete -c quick-lint-js -l help -d 'Print help message' -f
55
complete -c quick-lint-js -l version -d 'Print version information' -f
66
complete -c quick-lint-js -l lsp-server -d 'Run quick-lint-js in LSP server mode' -r
7+
complete -c quick-lint-js -l config-file -d 'Read configuration from a JSON file for later input files' -r
78
complete -c quick-lint-js -l stdin -d 'Read standard input as a JavaScript file' -r
89
complete -c quick-lint-js -l exit-fail-on -d 'Fail with a non-zero exit code if any of these errors are found (default: "all")' -r
910
complete -c quick-lint-js -l output-format -d 'Format to print feedback where FORMAT is one of: gnu-like (default if omitted), vim-qflist-json' -xa 'gnu-like vim-qflist-json'

src/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ void print_help_message() {
404404

405405
std::cout << "Usage: quick-lint-js [OPTIONS]... [FILE]...\n\n"
406406
<< "OPTIONS\n";
407+
print_option("--config-file=[FILE]",
408+
"Read configuration from a JSON file for later input files");
407409
print_option("--exit-fail-on=[CODES]",
408410
"Fail with a non-zero exit code if any of these");
409411
print_option("", "errors are found (default: \"all\")");

0 commit comments

Comments
 (0)