@@ -37,6 +37,8 @@ data class ParsedArgs(
3737 /* * File name to report when formating code from stdin */
3838 val stdinName : String? ,
3939 val editorConfig : Boolean ,
40+ /* * Suppress all non-error output. */
41+ val quiet : Boolean ,
4042) {
4143 companion object {
4244
@@ -84,6 +86,7 @@ data class ParsedArgs(
8486 | --do-not-remove-unused-imports Leaves all imports in place, even if not used
8587 | --enable-editorconfig Enable .editorconfig overrides for supported formatting options (limited)
8688 | see https://github.com/facebook/ktfmt/blob/main/README.md
89+ | --quiet Suppress all non-error output
8790 |
8891 |ARGFILE:
8992 | If the only argument begins with '@', the remainder of the argument is treated
@@ -110,6 +113,7 @@ data class ParsedArgs(
110113 var removeUnusedImports = true
111114 var stdinName: String? = null
112115 var editorConfig = false
116+ var quiet = false
113117
114118 if (" --help" in args || " -h" in args) return ParseResult .ShowMessage (HELP_TEXT )
115119 if (" --version" in args || " -v" in args) {
@@ -125,6 +129,7 @@ data class ParsedArgs(
125129 arg == " --set-exit-if-changed" -> setExitIfChanged = true
126130 arg == " --do-not-remove-unused-imports" -> removeUnusedImports = false
127131 arg == " --enable-editorconfig" -> editorConfig = true
132+ arg == " --quiet" -> quiet = true
128133 arg.startsWith(" --stdin-name=" ) ->
129134 stdinName =
130135 parseKeyValueArg(" --stdin-name" , arg)
@@ -158,6 +163,7 @@ data class ParsedArgs(
158163 setExitIfChanged,
159164 stdinName,
160165 editorConfig,
166+ quiet,
161167 )
162168 )
163169 }
0 commit comments