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

Replace docopt with clap #946

Closed
wants to merge 1 commit into from
Closed

Conversation

palango
Copy link

@palango palango commented Jun 15, 2022

This PR replaces docopt with clap.

Something similar was worked on in #737, but now clap includes the the derive macros that structopt had.

This also makes it possible to remove the serde dependency.

@palango palango changed the title Replace docopt by clap Replace docopt with clap Jun 15, 2022
@cuviper
Copy link
Member

cuviper commented Jun 16, 2022

I notice that the options are positioned less flexibly now -- is there a way to relax that?

e.g. life play --fps 144 fails, while life --fps 144 play works, but both worked before.

@LoganDark
Copy link

LoganDark commented Jun 18, 2022

IMHO, clap may be overkill here. You could probably use something like gumdrop instead, which outperforms every other crate in the ecosystem except for getargs (which does not have derive).

I am not sure if gumdrop supports options after positional arguments (getargs does).

@palango
Copy link
Author

palango commented Jun 27, 2022

I notice that the options are positioned less flexibly now -- is there a way to relax that?

Not that I'm aware of.

Do you think that this is worth changing, or should I just close the PR?

@cuviper
Copy link
Member

cuviper commented Jun 28, 2022

Like I said in #737, I don't really have an opinion on which crate we use -- especially now that I've moved that example program under rayon-demo, so this choice doesn't affect anything we actually publish.

The code does look cleaner here, so that's nice, but the option order inflexibility is a little annoying. Maybe those can be simple positional arguments instead of sub-commands? But I don't know if that will show up well in --help.

@palango palango closed this Nov 1, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants