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

Migrate from oof to clap #105

Closed
marcospb19 opened this issue Oct 19, 2021 · 3 comments · Fixed by #108
Closed

Migrate from oof to clap #105

marcospb19 opened this issue Oct 19, 2021 · 3 comments · Fixed by #108
Labels
enhancement New feature or request help wanted We would appreciate being helped to solve this high priority

Comments

@marcospb19
Copy link
Member

ouch used to use clap, then we switched to oof, our argparsing implementation, looking back I can tell it wasn't the best decision, my core flag detection implementation still has some little flaws and lacks basic features.

Here are some reasons why clap will be beneficial for ouch:

  1. Shell completions.
  2. Man page generation (with help2man).
  3. Adding flags is easier.
  4. No need to edit --help manually.
  5. Not worrying about ~90% of the argparsing error treatment.
  6. Help wraps if width is limited.
  7. Battle tested, our implementation was never 100% tested.
  8. Automatic typo checking for flags too (we used to check this manually only for subcommands).
  9. Deals correctly with the argument - (single hyphen, can be later be interpreted as STDIN and STDOUT to make ouch more versatile).
  10. Deals correctly with -- (separator, files that come after can contain hyphens, and are not interpreted as flags).
  11. More consistent error messages.
@marcospb19 marcospb19 added enhancement New feature or request help wanted We would appreciate being helped to solve this high priority labels Oct 19, 2021
@SpyrosRoum
Copy link
Contributor

Clap version 3 is currently in beta and it brings (At least) a feature that I find very appealing. It includes a copy of structopt.
Is this something you find appealing or do you prefer the classic way clap works?

@marcospb19
Copy link
Member Author

marcospb19 commented Oct 19, 2021

I like it too, if it adds no limitations compared to the "traditional" 2.33.x of doing things, then my only request is for you to use a specific release with something like a "strict version requirement" (rendered).

Here's an example in action with durt: cauebs/durt@94e5b60.

This way we avoid beta updates breaking your clap code (when it downloads a more recent version, but with breaking changes).

@SpyrosRoum
Copy link
Contributor

Agreed, we should keep it pinned while it's in beta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted We would appreciate being helped to solve this high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants