Skip to content

Commit 3d89a42

Browse files
committed
Verbose
1 parent 2112a1d commit 3d89a42

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

src/ServiceManagement/Compute/Commands.ServiceManagement.Preview/Automation/Generate-FunctionCommand.ps1

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function Generate-CliFunctionCommandImpl
174174

175175
$code += " var ${cli_param_name}Obj = null;" + $NEW_LINE;
176176
$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;
178178
$code += " var ${cli_param_name}FileContent = fs.readFileSync(options.parameterFile, 'utf8');" + $NEW_LINE;
179179
$code += " ${cli_param_name}Obj = JSON.parse(${cli_param_name}FileContent);" + $NEW_LINE;
180180
$code += " }" + $NEW_LINE;
@@ -185,22 +185,22 @@ function Generate-CliFunctionCommandImpl
185185
{
186186
[System.Reflection.PropertyInfo]$propInfoItem = $propItem;
187187
$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;
189189
$code += " ${cli_param_name}Obj.${cli_op_param_name} = options.${cli_op_param_name};" + $NEW_LINE;
190190
}
191191

192192
$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;
194194
}
195195
else
196196
{
197197
$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;
199199
if ((${cli_param_name} -eq 'Parameters') -or (${cli_param_name} -like '*InstanceIds'))
200200
{
201201
$code += " var ${cli_param_name}Obj = null;" + $NEW_LINE;
202202
$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;
204204
$code += " var fileContent = fs.readFileSync(options.parameterFile, 'utf8');" + $NEW_LINE;
205205
$code += " ${cli_param_name}Obj = JSON.parse(fileContent);" + $NEW_LINE;
206206
$code += " }" + $NEW_LINE;
@@ -209,7 +209,7 @@ function Generate-CliFunctionCommandImpl
209209
if ($oneStringListCheck[$optionParamName])
210210
{
211211
$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;
213213
$code += " ${cli_param_name}Obj = {};" + $NEW_LINE;
214214
$code += " ${cli_param_name}Obj.instanceIDs = ${cli_param_name}ValArr;" + $NEW_LINE;
215215
}
@@ -219,7 +219,7 @@ function Generate-CliFunctionCommandImpl
219219
}
220220

221221
$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;
223223
}
224224
}
225225
}
@@ -288,7 +288,7 @@ function Generate-CliFunctionCommandImpl
288288
$code += " .execute(function(options, _) {" + $NEW_LINE;
289289

290290
$output_content = $param_object_comment.Replace("`"", "\`"");
291-
$code += " //cli.output.info(`'" + $output_content + "`', _);" + $NEW_LINE;
291+
$code += " cli.output.verbose(`'" + $output_content + "`', _);" + $NEW_LINE;
292292

293293
$file_content = $param_object_comment_no_compress.Replace($NEW_LINE, "\r\n").Replace("`r", "\r").Replace("`n", "\n");
294294
$file_content = $file_content.Replace("`"", "\`"").Replace(' ', '');
@@ -297,9 +297,9 @@ function Generate-CliFunctionCommandImpl
297297
$code += " filePath = options.parameterFile;" + $NEW_LINE;
298298
$code += " }" + $NEW_LINE;
299299
$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;
303303
$code += " });" + $NEW_LINE;
304304
$code += $NEW_LINE;
305305

@@ -313,22 +313,22 @@ function Generate-CliFunctionCommandImpl
313313
$code += " .option('--value <value>', `$('The JSON value.'))" + $NEW_LINE;
314314
$code += " .option('--parse', `$('Parse the JSON value to object.'))" + $NEW_LINE;
315315
$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;
321321
$code += " if (options.parse) {" + $NEW_LINE;
322322
$code += " options.value = JSON.parse(options.value);" + $NEW_LINE;
323323
$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;
328328
$code += " var fileContent = fs.readFileSync(options.parameterFile, 'utf8');" + $NEW_LINE;
329329
$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;
332332
$code += " if (options.operation == 'add') {" + $NEW_LINE;
333333
$code += " jsonpatch.apply(${cli_param_name}Obj, [{op: options.operation, path: options.path, value: options.value}]);" + $NEW_LINE;
334334
$code += " }" + $NEW_LINE;
@@ -339,14 +339,14 @@ function Generate-CliFunctionCommandImpl
339339
$code += " jsonpatch.apply(${cli_param_name}Obj, [{op: options.operation, path: options.path, value: options.value}]);" + $NEW_LINE;
340340
$code += " }" + $NEW_LINE;
341341
$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;
346346
$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;
350350
$code += " });" + $NEW_LINE;
351351
$code += $NEW_LINE;
352352

0 commit comments

Comments
 (0)