@@ -174,7 +174,7 @@ function Generate-CliFunctionCommandImpl
174
174
175
175
$code += " var ${cli_param_name} Obj = null;" + $NEW_LINE ;
176
176
$code += " if (options.parameterFile) {" + $NEW_LINE ;
177
- $code += " // cli.output.info (`' Reading file content from: \`"`' + options.parameterFile + `' \`"`' );" + $NEW_LINE ;
177
+ $code += " cli.output.verbose (`' Reading file content from: \`"`' + options.parameterFile + `' \`"`' );" + $NEW_LINE ;
178
178
$code += " var ${cli_param_name} FileContent = fs.readFileSync(options.parameterFile, 'utf8');" + $NEW_LINE ;
179
179
$code += " ${cli_param_name} Obj = JSON.parse(${cli_param_name} FileContent);" + $NEW_LINE ;
180
180
$code += " }" + $NEW_LINE ;
@@ -185,22 +185,22 @@ function Generate-CliFunctionCommandImpl
185
185
{
186
186
[System.Reflection.PropertyInfo ]$propInfoItem = $propItem ;
187
187
$cli_op_param_name = Get-CliNormalizedName $propInfoItem.Name ;
188
- $code += " // cli.output.info ('${cli_op_param_name} = ' + options.${cli_op_param_name} );" + $NEW_LINE ;
188
+ $code += " cli.output.verbose ('${cli_op_param_name} = ' + options.${cli_op_param_name} );" + $NEW_LINE ;
189
189
$code += " ${cli_param_name} Obj.${cli_op_param_name} = options.${cli_op_param_name} ;" + $NEW_LINE ;
190
190
}
191
191
192
192
$code += " }" + $NEW_LINE ;
193
- $code += " // cli.output.info ('${cli_param_name} Obj = ' + JSON.stringify(${cli_param_name} Obj));" + $NEW_LINE ;
193
+ $code += " cli.output.verbose ('${cli_param_name} Obj = ' + JSON.stringify(${cli_param_name} Obj));" + $NEW_LINE ;
194
194
}
195
195
else
196
196
{
197
197
$cli_param_name = Get-CliNormalizedName $optionParamName ;
198
- $code += " // cli.output.info ('${cli_param_name} = ' + options.${cli_param_name} );" + $NEW_LINE ;
198
+ $code += " cli.output.verbose ('${cli_param_name} = ' + options.${cli_param_name} );" + $NEW_LINE ;
199
199
if ((${cli_param_name} -eq ' Parameters' ) -or (${cli_param_name} -like ' *InstanceIds' ))
200
200
{
201
201
$code += " var ${cli_param_name} Obj = null;" + $NEW_LINE ;
202
202
$code += " if (options.parameterFile) {" + $NEW_LINE ;
203
- $code += " // cli.output.info (`' Reading file content from: \`"`' + options.parameterFile + `' \`"`' );" + $NEW_LINE ;
203
+ $code += " cli.output.verbose (`' Reading file content from: \`"`' + options.parameterFile + `' \`"`' );" + $NEW_LINE ;
204
204
$code += " var fileContent = fs.readFileSync(options.parameterFile, 'utf8');" + $NEW_LINE ;
205
205
$code += " ${cli_param_name} Obj = JSON.parse(fileContent);" + $NEW_LINE ;
206
206
$code += " }" + $NEW_LINE ;
@@ -209,7 +209,7 @@ function Generate-CliFunctionCommandImpl
209
209
if ($oneStringListCheck [$optionParamName ])
210
210
{
211
211
$code += " var ${cli_param_name} ValArr = options.${cli_param_name} .split(',');" + $NEW_LINE ;
212
- $code += " // cli.output.info (`' ${cli_param_name} ValArr : `' + ${cli_param_name} ValArr);" + $NEW_LINE ;
212
+ $code += " cli.output.verbose (`' ${cli_param_name} ValArr : `' + ${cli_param_name} ValArr);" + $NEW_LINE ;
213
213
$code += " ${cli_param_name} Obj = {};" + $NEW_LINE ;
214
214
$code += " ${cli_param_name} Obj.instanceIDs = ${cli_param_name} ValArr;" + $NEW_LINE ;
215
215
}
@@ -219,7 +219,7 @@ function Generate-CliFunctionCommandImpl
219
219
}
220
220
221
221
$code += " }" + $NEW_LINE ;
222
- $code += " // cli.output.info ('${cli_param_name} Obj = ' + JSON.stringify(${cli_param_name} Obj));" + $NEW_LINE ;
222
+ $code += " cli.output.verbose ('${cli_param_name} Obj = ' + JSON.stringify(${cli_param_name} Obj));" + $NEW_LINE ;
223
223
}
224
224
}
225
225
}
@@ -288,7 +288,7 @@ function Generate-CliFunctionCommandImpl
288
288
$code += " .execute(function(options, _) {" + $NEW_LINE ;
289
289
290
290
$output_content = $param_object_comment.Replace (" `" " , " \`" " );
291
- $code += " // cli.output.info (`' " + $output_content + " `' , _);" + $NEW_LINE ;
291
+ $code += " cli.output.verbose (`' " + $output_content + " `' , _);" + $NEW_LINE ;
292
292
293
293
$file_content = $param_object_comment_no_compress.Replace ($NEW_LINE , " \r\n" ).Replace(" `r " , " \r" ).Replace(" `n " , " \n" );
294
294
$file_content = $file_content.Replace (" `" " , " \`" " ).Replace(' ' , ' ' );
@@ -297,9 +297,9 @@ function Generate-CliFunctionCommandImpl
297
297
$code += " filePath = options.parameterFile;" + $NEW_LINE ;
298
298
$code += " }" + $NEW_LINE ;
299
299
$code += " fs.writeFileSync(filePath, beautify(`' " + $file_content + " `' ));" + $NEW_LINE ;
300
- $code += " // cli.output.info (`' =====================================`' );" + $NEW_LINE ;
301
- $code += " // cli.output.info (`' Parameter file output to: `' + filePath);" + $NEW_LINE ;
302
- $code += " // cli.output.info (`' =====================================`' );" + $NEW_LINE ;
300
+ $code += " cli.output.verbose (`' =====================================`' );" + $NEW_LINE ;
301
+ $code += " cli.output.verbose (`' Parameter file output to: `' + filePath);" + $NEW_LINE ;
302
+ $code += " cli.output.verbose (`' =====================================`' );" + $NEW_LINE ;
303
303
$code += " });" + $NEW_LINE ;
304
304
$code += $NEW_LINE ;
305
305
@@ -313,22 +313,22 @@ function Generate-CliFunctionCommandImpl
313
313
$code += " .option('--value <value>', `$ ('The JSON value.'))" + $NEW_LINE ;
314
314
$code += " .option('--parse', `$ ('Parse the JSON value to object.'))" + $NEW_LINE ;
315
315
$code += " .execute(function(options, _) {" + $NEW_LINE ;
316
- $code += " // cli.output.info (options.parameterFile, _);" + $NEW_LINE ;
317
- $code += " // cli.output.info (options.operation);" + $NEW_LINE ;
318
- $code += " // cli.output.info (options.path);" + $NEW_LINE ;
319
- $code += " // cli.output.info (options.value);" + $NEW_LINE ;
320
- $code += " // cli.output.info (options.parse);" + $NEW_LINE ;
316
+ $code += " cli.output.verbose (options.parameterFile, _);" + $NEW_LINE ;
317
+ $code += " cli.output.verbose (options.operation);" + $NEW_LINE ;
318
+ $code += " cli.output.verbose (options.path);" + $NEW_LINE ;
319
+ $code += " cli.output.verbose (options.value);" + $NEW_LINE ;
320
+ $code += " cli.output.verbose (options.parse);" + $NEW_LINE ;
321
321
$code += " if (options.parse) {" + $NEW_LINE ;
322
322
$code += " options.value = JSON.parse(options.value);" + $NEW_LINE ;
323
323
$code += " }" + $NEW_LINE ;
324
- $code += " // cli.output.info (options.value);" + $NEW_LINE ;
325
- $code += " // cli.output.info (`' =====================================`' );" + $NEW_LINE ;
326
- $code += " // cli.output.info (`' Reading file content from: \`"`' + options.parameterFile + `' \`"`' );" + $NEW_LINE ;
327
- $code += " // cli.output.info (`' =====================================`' );" + $NEW_LINE ;
324
+ $code += " cli.output.verbose (options.value);" + $NEW_LINE ;
325
+ $code += " cli.output.verbose (`' =====================================`' );" + $NEW_LINE ;
326
+ $code += " cli.output.verbose (`' Reading file content from: \`"`' + options.parameterFile + `' \`"`' );" + $NEW_LINE ;
327
+ $code += " cli.output.verbose (`' =====================================`' );" + $NEW_LINE ;
328
328
$code += " var fileContent = fs.readFileSync(options.parameterFile, 'utf8');" + $NEW_LINE ;
329
329
$code += " var ${cli_param_name} Obj = JSON.parse(fileContent);" + $NEW_LINE ;
330
- $code += " // cli.output.info (`' JSON object:`' );" + $NEW_LINE ;
331
- $code += " // cli.output.info (JSON.stringify(${cli_param_name} Obj));" + $NEW_LINE ;
330
+ $code += " cli.output.verbose (`' JSON object:`' );" + $NEW_LINE ;
331
+ $code += " cli.output.verbose (JSON.stringify(${cli_param_name} Obj));" + $NEW_LINE ;
332
332
$code += " if (options.operation == 'add') {" + $NEW_LINE ;
333
333
$code += " jsonpatch.apply(${cli_param_name} Obj, [{op: options.operation, path: options.path, value: options.value}]);" + $NEW_LINE ;
334
334
$code += " }" + $NEW_LINE ;
@@ -339,14 +339,14 @@ function Generate-CliFunctionCommandImpl
339
339
$code += " jsonpatch.apply(${cli_param_name} Obj, [{op: options.operation, path: options.path, value: options.value}]);" + $NEW_LINE ;
340
340
$code += " }" + $NEW_LINE ;
341
341
$code += " var updatedContent = JSON.stringify(${cli_param_name} Obj);" + $NEW_LINE ;
342
- $code += " // cli.output.info (`' =====================================`' );" + $NEW_LINE ;
343
- $code += " // cli.output.info (`' JSON object (updated):`' );" + $NEW_LINE ;
344
- $code += " // cli.output.info (JSON.stringify(${cli_param_name} Obj));" + $NEW_LINE ;
345
- $code += " // cli.output.info (`' =====================================`' );" + $NEW_LINE ;
342
+ $code += " cli.output.verbose (`' =====================================`' );" + $NEW_LINE ;
343
+ $code += " cli.output.verbose (`' JSON object (updated):`' );" + $NEW_LINE ;
344
+ $code += " cli.output.verbose (JSON.stringify(${cli_param_name} Obj));" + $NEW_LINE ;
345
+ $code += " cli.output.verbose (`' =====================================`' );" + $NEW_LINE ;
346
346
$code += " fs.writeFileSync(options.parameterFile, beautify(updatedContent));" + $NEW_LINE ;
347
- $code += " // cli.output.info (`' =====================================`' );" + $NEW_LINE ;
348
- $code += " // cli.output.info (`' Parameter file updated at: `' + options.parameterFile);" + $NEW_LINE ;
349
- $code += " // cli.output.info (`' =====================================`' );" + $NEW_LINE ;
347
+ $code += " cli.output.verbose (`' =====================================`' );" + $NEW_LINE ;
348
+ $code += " cli.output.verbose (`' Parameter file updated at: `' + options.parameterFile);" + $NEW_LINE ;
349
+ $code += " cli.output.verbose (`' =====================================`' );" + $NEW_LINE ;
350
350
$code += " });" + $NEW_LINE ;
351
351
$code += $NEW_LINE ;
352
352
0 commit comments