Skip to content

Commit f663d34

Browse files
Document the CLI client
1 parent a5c8e48 commit f663d34

File tree

1 file changed

+71
-2
lines changed

1 file changed

+71
-2
lines changed

README.adoc

Lines changed: 71 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ _SARIF_ mode, paths reported are always absolute.
249249
* Default: `true`
250250
* Required: **no**
251251

252-
Enables the console output to be colorized. This is only useful if the
253-
xref:#reporter[reporter] is set to `plain` or `plain?group_by_file`:
252+
Setting this flag enables the console output to be colorized. This is only
253+
useful if the xref:#reporter[reporter] is set to `plain` or `plain?group_by_file`:
254254

255255
[source,yaml]
256256
----
@@ -341,3 +341,72 @@ the `java-distribution` and `java-version` input parameters)
341341
| No source files to check were found
342342
| **Yes**
343343
|===
344+
345+
[#diktat-cli]
346+
== Using the command-line client
347+
348+
Alternatively, if you wish to run _diKTat_ locally (e. g.: as a _Vim_ plug-in),
349+
or you're using a different CI/CD server, you can try the command-line client.
350+
Its exit codes are xref:#exit-codes[the same] as those of the action.
351+
352+
[#diktat-cli-features]
353+
=== Features
354+
355+
* Written in _UNIX Shell_ (~500 lines of code)
356+
* BSD-compatible
357+
* Also works in Windows (_Git Bash_, _Cygwin_, or _MSys2_)
358+
* Automatically downloads `ktlint` and `diktat` far JARs
359+
* Accepts all essential `ktlint` command-line arguments
360+
361+
[#diktat-cli-usage]
362+
=== Usage
363+
364+
[source,bash]
365+
----
366+
diktat [OPTION]... [FILE]...
367+
----
368+
369+
[#diktat-cli-options]
370+
=== Option summary
371+
372+
[cols="1,3"]
373+
|===
374+
| Command-line switch | Meaning
375+
376+
| `-c CONFIG`, `--config=CONFIG`
377+
| Specify the location of the YAML configuration file. By default,
378+
`diktat-analysis.yml` in the current directory is used.
379+
380+
| `-r REPORTER`, `--reporter=REPORTER`
381+
| The reporter to use, one of: `plain` (the default), `plain?group_by_file`,
382+
`json`, `sarif`, `checkstyle`, `html`.
383+
384+
| `-o OUTPUT`, `--output=OUTPUT`
385+
| Redirect the reporter output to a file. Use `-o -` to force using the standard
386+
output.
387+
388+
| `--color`
389+
| Colorize the output.
390+
391+
| `--relative`
392+
| Relativize file paths with respect to the working directory. By default,
393+
absolute file paths get reported.
394+
395+
| `--no-download-progress`
396+
| Do not show the progress bar as the binaries get downloaded.
397+
398+
| `-d`, `--debug`
399+
| Enable the debug output.
400+
401+
| `-h`, `--help`
402+
| Display the help text and exit.
403+
404+
| `-l`, `--license`
405+
| Display the license and exit.
406+
407+
| `-v`, `--verbose`
408+
|Enable the verbose output.
409+
410+
| `-V`, `--version`
411+
|Output version information and exit.
412+
|===

0 commit comments

Comments
 (0)