-
Notifications
You must be signed in to change notification settings - Fork 186
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
Mutually exclusive groups don't appear to work #289
Comments
For a UI, what sort of things make sense for mutually exclusive groups? I've seen some examples online of people using radio buttons to select which element they wish to fill out, but I'd prefer to not force another click. |
@Chris7 Sorry for the late reply, and huge thanks for looking into the issues that I posted. Good question, and take my thoughts here with a grain of salt as I'm not a front end developer, nor a common end-user. Radio buttons is also what I've seen used, I guess it's either that or a drop-down, but with the latter I'm not quite sure how you'd smoothly handle the case where the mutually exclusive selections are of different type. For example: mutex_grp = parser.add_mutually_exclusive_group(required=True)
mutex_grp.add_argument("--first", action="store_true")
mutex_grp.add_argument("--second", type="str") I can't come up with a better solution than just rendering the different inputs "normally" inside of a bounding box, and having a radio button next to each. It's transparent in that it lets the user see all of the available options and what can be entered into them. It's also important that, if the group is not required, that there is a possibility of selecting no option. |
|
A parser with a mutually exclusive argument group behaves pretty strangely. I've noted two problems:
Here's a small script recreating both issues:
I think Gooey has support for mutex groups, so maybe inspiration can be taken from there?
The text was updated successfully, but these errors were encountered: