Skip to content

Commit 94a2749

Browse files
committed
Make endpoint(s) arguments instead of options
This makes the calling simpler: ``` dotnet echo https://0.0.0.0:4242, for example ``` Fixes #6
1 parent 902c40d commit 94a2749

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

readme.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ echo
2121
A trivial program that echoes whatever is sent to it via HTTP or gRPC
2222
2323
Usage:
24-
echo [options]
24+
echo [options] [<endpoint>...]
25+
26+
Arguments:
27+
<endpoint> Endpoint to listen on such as https://127.0.0.0:8080/ [default: https://127.0.0.1:4242/]
2528
2629
Options:
27-
-p, --prefix <prefix> Prefix to listen on such as http://127.0.0.0:80/ [default: http://*:80/]
28-
--version Show version information
29-
-?, -h, --help Show help and usage information
30+
-?, -h, --help Show help and usage information
3031
```
3132

3233
The program will automatically check for updates once a day and recommend updating
@@ -55,6 +56,7 @@ Example of a .NET client to run `echo` in the `chamber` service:
5556
<Project>
5657
...
5758
<ItemGroup>
59+
<PackageReference Include="Google.Protobuf" Version="*" />
5860
<PackageReference Include="Grpc.Net.Client" Version="*" />
5961
<PackageReference Include="Grpc.Tools" Version="*" />
6062
</ItemGroup>

src/dotnet-echo/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
var command = new RootCommand("A trivial program that echoes whatever is sent to it via HTTP.")
3737
{
38-
new Option<string[]>(new[] { "--prefix", "-p" }, () => new [] { "http://127.0.0.1:8080/" }, "Prefix to listen on such as http://127.0.0.0:8080/")
38+
new Argument<string[]>("endpoint", () => new [] { "https://127.0.0.1:4242/" }, "Endpoint(s) to listen on such as https://127.0.0.0:8080/")
3939
}.WithConfigurableDefaults("echo");
4040

4141
command.Handler = CommandHandler.Create<string[], CancellationToken>(

0 commit comments

Comments
 (0)