Skip to content

Commit 8ee8b7c

Browse files
committed
Make proxy command options optional for method, body, header
Removed Required flag from --method, --body, and --header options in ProxyCommand, making them optional. Also reordered --method declaration for improved clarity. Descriptions remain unchanged. #62
1 parent 61ca2bd commit 8ee8b7c

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

‎src/SynentraCtl/Commands/ProxyCommand.cs‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,26 @@ internal static class ProxyCommand
1111
{
1212
public static Command Create(IServiceProvider serviceProvider)
1313
{
14-
var methodOption = new Option<string>("--method")
15-
{
16-
Description = "HTTP method",
17-
DefaultValueFactory = (result) => "GET"
18-
};
19-
2014
var urlOption = new Option<string>("--path")
2115
{
2216
Description = "Request path (appended to gateway base URL)",
2317
Required = true
2418
};
2519

20+
var methodOption = new Option<string>("--method")
21+
{
22+
Description = "HTTP method",
23+
DefaultValueFactory = (result) => "GET"
24+
};
25+
2626
var bodyOption = new Option<string>("--body")
2727
{
28-
Description = "Request body (raw string)",
29-
Required = true
28+
Description = "Request body (raw string)"
3029
};
3130

3231
var headerOption = new Option<string[]?>("--header")
3332
{
34-
Description = "Request headers in format Key:Value",
35-
Required = true
33+
Description = "Request headers in format Key:Value"
3634
};
3735

3836
var command = new Command("proxy", "Forwards an HTTP request to the Synentra gateway")

0 commit comments

Comments
 (0)