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

Automatically generate --help #2

Open
ReneSac opened this issue Apr 3, 2015 · 2 comments
Open

Automatically generate --help #2

ReneSac opened this issue Apr 3, 2015 · 2 comments

Comments

@ReneSac
Copy link

ReneSac commented Apr 3, 2015

This module should automatically generate the help text based on the command line interface provided and not force you to repeat yourself. Kinda the opposite of: https://github.com/docopt/docopt.nim

@fenekku
Copy link
Owner

fenekku commented Apr 9, 2015

Thanks for pointing that out. This is an 'ugly' problem I find.

Right now the arguments and options are not associated with a custom name so mapping them back to a help text would result in <int> and such which is not great. Adding a custom name as another parameter is too distracting. Using the argument variable name is our best bet but I don't know how to do so without going macros all the way -which I don't want to do.

An auto-generated help/usage text should be overridden by exitoption "--help" or instead only be made available through a documented call so that the end result may be further customizable and the format is not forced upon the user.

It is also a slippery slope, there is a ton of additional metadata you would want to squeeze in to make the usage/help text actually helpful:

  • the help text of each argument and option
  • the overall description
  • you might as well have the man page generated...

I am ok with auto-generating a one line usage text. For anything more involved I actually like that the developer needs to write it out. I am open to proposed solutions though 😸 .

I am abiding by my design rule until there is an elegant way to deal with this:
"Keep it simple and streamlined. Command line parsers can do a lot for you, but I prefer to be in adequate control."

@ReneSac
Copy link
Author

ReneSac commented Apr 9, 2015

Yeah, it indeed is somewhat of a slippery slope. I would surely ask for the first two bullet points you listed. Only because I rarely use man pages, though. ;)

But on the other hand, for anything I would have to write the proper help text, I would probably migrate to a future macroed docopt. The competion is open! XD

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

2 participants