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

Cookbook: recipes for parse-command-line-arguments #2573

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

richardhuxton
Copy link
Contributor

One example with Cmdliner, and two from the standard library (Sys.argv and Arg),

Happy to rework them if I've missed some details.

@sabine sabine changed the title cookbook recipes for parse-command-line-arguments Cookbook: recipes for parse-command-line-arguments Oct 1, 2024
Copy link
Collaborator

@sabine sabine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These recipes have two problems:

  • cmdliner example focuses on one oddly-specific task and doesn't cover enough API surface (for comparison, look at https://rust-lang-nursery.github.io/rust-cookbook/cli/arguments.html#parse-command-line-arguments)
  • stdlib example does not implement the same task as cmdliner example. A point of the cookbook is comparing the exact same task between different libraries / stdlib, so all the recipes for a task need to implement the same task. To facilitate this, it can help to add a description for the task, when it is unclear.

ETA: also, as a general remark, avoiding to open the modules in question does a lot to help people see where values are coming from (we do not have a LSP running here that would allow to inspect the code).

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

Successfully merging this pull request may close these issues.

4 participants