Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help default output syntax not standard.. make extensible or change? #34

Open
Meai1 opened this issue Mar 17, 2015 · 2 comments
Open

Help default output syntax not standard.. make extensible or change? #34

Meai1 opened this issue Mar 17, 2015 · 2 comments

Comments

@Meai1
Copy link

Meai1 commented Mar 17, 2015

Output of --help:

p:Platform MyDescription
s:Syntax Syntax for the state machine

is not really helpful. It does not tell the user that he has to actually pass via - or --
And the description should be on the next line indented, this way you would also avoid the weird look because currently you just do a specific amount of spaces/tabs and if the arg string length is different, the descriptions all start at a different indention level.
And the help should be displayed by default if no args were parsed.

Desired output of --help

-p --platform (Required)
     MyDescription
-s --syntax 
     Syntax for the state machine

So this is the kind of format you expect on linux tools and I think it would be very readable.

@siywilliams
Copy link
Member

Thanks Meai1

I'm surprised I've got away this long with having such a bad help formatter. I have actually been working on a better implementation in the formatter branch.

You can specify a different formatter to use when you setup the help option (if you wanted to roll your own):

var parser = new FluentCommandLineParser();
parser.SetupHelp("?").WithCustomFormatter(new CommandLineOptionFormatterMark2());

If you wanted to try out the new formatter you can either grab the formatter build from
TeamCity
, or copy the CommandLineOptionFormatterMark2 class into your project and add it to the parser using WithCustomerFormatter(ICommandLineOptionFormatter)

Although not exactly as you described, it does produce output like the following

-p, --platform  MyDescription
-s, --syntax    Syntax for the state machine

I'm hoping to find some time to release these improvement as well as others soon.

@brecko
Copy link

brecko commented Mar 15, 2016

Great library btw. When do you think this will be included in the released version on NuGet? I am starting to get requests from user to have the format better aligned...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants