Skip to content

Commit b50ad5c

Browse files
committed
Include usage example in CLI help command output
1 parent abd1d87 commit b50ad5c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/SeqCli/Cli/Commands/App/UpdateCommand.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ protected override async Task<int> Run()
8181
return 1;
8282
}
8383

84+
if (_all && _version != null)
85+
{
86+
Log.Error("The `all` and `version` options are incompatible");
87+
return 1;
88+
}
89+
8490
if (!_all && _id == null && _name == null)
8591
{
8692
Log.Error("One of `id`, `name`, or `all` must be specified");

src/SeqCli/Cli/Commands/HelpCommand.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,17 @@ protected override Task<int> Run(string[] unrecognized)
6363
var subCommandHelp = subCommand == null ? "" : " " + subCommand;
6464
Console.WriteLine(name + " " + cmd.Metadata.Name + subCommandHelp + argHelp);
6565
Console.WriteLine();
66+
6667
Console.WriteLine(cmd.Metadata.HelpText);
6768
Console.WriteLine();
69+
70+
if (cmd.Metadata.Example != null)
71+
{
72+
Console.WriteLine("Example:");
73+
Console.WriteLine($" {cmd.Metadata.Example}");
74+
Console.WriteLine();
75+
}
76+
6877
cmd.Value.Value.PrintUsage();
6978
return Task.FromResult(0);
7079
}

0 commit comments

Comments
 (0)