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

Add help message comments for constraints #132

Open
Fryguy opened this issue Apr 19, 2022 · 1 comment
Open

Add help message comments for constraints #132

Fryguy opened this issue Apr 19, 2022 · 1 comment

Comments

@Fryguy
Copy link
Member

Fryguy commented Apr 19, 2022

From #130 (comment), @nanobowers wrote:

...should there any default notation in the help message for exclusivity clauses? If the developer uses either:, conflicts: or depends, seems like the only good way to find out is to try it and get an error message, or the developer would have to manually note it with the banner message.

@nanobowers
Copy link
Collaborator

I was thinking about this a little more and am not sure the best way to implement it.
One thought was an addition to each line:

Options:
  -c, --cone       Ice cream cone
  -z, --zippy      It zips (conflicts with --zapzy)
  -a, --zapzy      It zapz (conflicts with --zippy)
  -b, --big-bug    Madagascar cockroach

It's possible to have multiple things in the conficts/depends/either so it may get lengthy.
I think it might be possible to create multiple depends/conflicts/either that affect the same option so the line could be wildly long.
Another option may be to represent with some notation on the line and then later write the constraints below:

Options:
  -c, --cone       Ice cream cone (*)
  -z, --zippy      It zips (**)
  -a, --zapzy      It zapz (**)
  -b, --big-bug    Madagascar cockroach (*)
Constraints:
 * : depends [ --cone, --big-bug ]
 ** : conflicts [--zippy, --zapzy]

I have created complex banners in the past and depending on how it's done the placement of the Constraints: section in the help may be inconvenient.

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

No branches or pull requests

2 participants