Skip to content

Commit

Permalink
Added parameter default value logic
Browse files Browse the repository at this point in the history
  • Loading branch information
leandromonaco committed Feb 18, 2025
1 parent 076654c commit a4341ee
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/DevEx.Console/Commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@
"Parameters": [
{
"Name": "isVerbose",
"Description": "Show HTTP Request/Response"
"Description": "Show HTTP Request/Response",
"DefaultValue": "false"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/DevEx.Console/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.0.3"
"version": "0.0.4"
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,16 @@ public static List<string> GetCommandLinesFromFile(string filePath)
{
foreach (var param in sub.Parameters)
{
// Use --paramName followed by a placeholder for its value.
line += $" --{param.Name} {{{param.Name}}}";
}
if (string.IsNullOrEmpty(param.DefaultValue))
{
// Use --paramName followed by a placeholder for its value.
line += $" --{param.Name} {{{param.Name}}}";
}
else
{
// Use --paramName followed by its default value.
line += $" --{param.Name} {param.DefaultValue}";
}
}

commandLines.Add($"dxc {line}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ public class Parameter
{
public string Name { get; set; }
public string Description { get; set; }
public string DefaultValue { get; set; }
}
}

0 comments on commit a4341ee

Please sign in to comment.