Closed schveiguy closed 2 years ago
Did you try Command
attribute?
@(Command.Description("Description for the whole program"))
struct MainProgram
{
...
}
Does that work? Because I thought Command required a parameter of the program name. I tried Command().Description(...)
and it failed to compile.
I'll check when I get a chance.
To be clearer, I want to use the automatic mechanism that detects the program name (I'm assuming from argv[0]) and uses that for the usage, but still provides a nice description.
My current implementation uses Command("foo").Description(...)
and it works, where "foo" is the program name. This is OK if there is no other way, but I would prefer to be more DRY.
It should work - if you don't specify command name then it's gonna use argv[0]
. Let me know if it does not.
I just checked with one of the examples - compilation failed. I'll fix it.
@schveiguy I added this to example:
@(Command.Description("Description of main program"))
struct Program
{
...
}
Thanks!
For a subcommand, you can affect the description by attributing the command with information.
But I want to just add a description for the whole program. Is that possible to do?