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

remove all clap-related code #10

Merged
merged 8 commits into from
Aug 6, 2018
Merged

remove all clap-related code #10

merged 8 commits into from
Aug 6, 2018

Conversation

yoshuawuyts
Copy link
Collaborator

@yoshuawuyts yoshuawuyts commented Aug 2, 2018

Removes all clap related code, in favor of moving it to https://github.com/clap-rs/clap_generate. (Closes #9) Part of a set of 2 PRs to create a demo of Clap + Man working for the 2018 milestone. We should probably hold off merging this until a PR to clap_generate is done. Thanks!

@yoshuawuyts
Copy link
Collaborator Author

Okay, I think this is good for review now. Bridged most of the code from @spacekookie with the code I wrote. Created an API that's pretty similar to #2, which should resemble the clap API a lot ✨

Copy link
Contributor

@killercup killercup left a comment

Choose a reason for hiding this comment

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

Awesome! Can't wait for this to be part of my regular clap setup :)

(There are probably quite a few API details to iron out and abstraction we could invent, but if the general use-case is "the user doesn't need to interact with this at all and just gets man pages" we can easily iterate on this)

///
/// ## Implementation Note
/// This currently only returns the status code `0`, and takes no arguments. We
/// should let it take arguments.
Copy link
Contributor

Choose a reason for hiding this comment

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

you can probably add

  • 1 -- current clap version exit with this on when passing wrong flags (yes it should be 64)
  • 101 Rest's default panic handler exit code

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

101 Rest's default panic handler exit code

You mean Rust's, right? Can there be any interference with panic handlers?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry to comment to so late -- yes, "Rust", of course, still trying to teach my phone I'd rather to Rust than rest ;)

Panic handlers like human-panick don't call process::exit so I think they too will exit with 101.

@yoshuawuyts yoshuawuyts changed the title [do not merge] remove all clap-related code remove all clap-related code Aug 6, 2018
@yoshuawuyts
Copy link
Collaborator Author

Cool, added more exit codes as per @killercup's suggestion.

@yoshuawuyts yoshuawuyts merged commit 16b74df into master Aug 6, 2018
@yoshuawuyts yoshuawuyts deleted the declap branch August 6, 2018 08:23
@yoshuawuyts
Copy link
Collaborator Author

v0.1.0

@intgr
Copy link

intgr commented Mar 22, 2021

Did this feature get removed from clap_generate? I can no longer find documentation for it (https://docs.rs/clap_generate/3.0.0-beta.2/clap_generate/) and there's only an open issue in clap's GitHub clap-rs/clap#552

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.

Move clap v3 -> man glue code to clap_generate
3 participants