* Setup the required arguments for sywac to process output configurations * * @param {sywac} main
( main )
| 156 | * @param {sywac} main |
| 157 | */ |
| 158 | argsSetup_output( main ) { |
| 159 | |
| 160 | // Self reference |
| 161 | let self = this; |
| 162 | |
| 163 | // We disabled the --json, and --table |
| 164 | // -------------------------------------------- |
| 165 | |
| 166 | // // The various configuration options |
| 167 | // main.boolean("--json, --jsonOutput", { |
| 168 | // description: "Output result as a single final JSON object, disables default step by step line output" |
| 169 | // }) |
| 170 | |
| 171 | // // Output using table format instead |
| 172 | // main.boolean("--table, --tableOutput", { |
| 173 | // description: "Output result in a table like format, note that some commands (eg. list) defaults to this format" |
| 174 | // }) |
| 175 | |
| 176 | // @TODO - consider if there is demand to support this use case specifically |
| 177 | // main.file("--jsonOutputFile <json-out-file>", { |
| 178 | // description: "Output the JSON result into the file seperately, does not disable step by step line output" |
| 179 | // }) |
| 180 | |
| 181 | // Trace and silent supporessions |
| 182 | // -------------------------------------------- |
| 183 | main.boolean("-t, --trace", { |
| 184 | description: "Extremely extremely verbose and noisy logging of all API calls [Note: this will log provided secrets]" |
| 185 | }) |
| 186 | main.boolean("-s, --silent", { |
| 187 | description: "Surpression of output stream, disables std/json output" |
| 188 | }) |
| 189 | |
| 190 | // Processing the various configuration settings |
| 191 | main.layeredCheck((argv, context) => { |
| 192 | if( argv.table || argv.tableOutput ) { |
| 193 | this.stdOutput = false; |
| 194 | this.tableOutput = true; |
| 195 | this.jsonOutput = false; |
| 196 | } |
| 197 | if( argv.json || argv.jsonOutput ) { |
| 198 | this.stdOutput = false; |
| 199 | this.tableOutput = false; |
| 200 | this.jsonOutput = true; |
| 201 | } |
| 202 | // if( argv.jsonOutputFile ) { |
| 203 | // this.jsonOutputFile = arv.jsonOutputFile; |
| 204 | // } |
| 205 | if( argv.trace ) { |
| 206 | this.trace = true; |
| 207 | } |
| 208 | if( argv.silent ) { |
| 209 | this.silent = true; |
| 210 | this.stdOutput = false; |
| 211 | this.jsonOutput = false; |
| 212 | this.tableOutput = false; |
| 213 | } |
| 214 | }); |
| 215 | } |
nothing calls this directly
no outgoing calls
no test coverage detected