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

Re-introduce docopt? #87

Closed
emilio opened this issue Oct 14, 2016 · 10 comments
Closed

Re-introduce docopt? #87

emilio opened this issue Oct 14, 2016 · 10 comments

Comments

@emilio
Copy link
Contributor

emilio commented Oct 14, 2016

Seems like the performance issues docopt had (#46, docopt/docopt.rs#195) are fixed.

Should we restore it?

@Yamakaky
Copy link
Contributor

An alternative would be to use clap, which ia also very cool.

@fitzgen
Copy link
Member

fitzgen commented Oct 14, 2016

I like docopt because it forces us to at least minimally document our command line flags. That is a great property to have.

@Yamakaky
Copy link
Contributor

I too love docopt for that. Clap does the reverse: it generates the --help from the options.

@fitzgen
Copy link
Member

fitzgen commented Oct 14, 2016

I was under the impression that calling .help("...") on clap's builder was optional (meaning that the documentation is optional even if the help text contains all flags). Is that incorrect?

@Yamakaky
Copy link
Contributor

If you don't set it, clap auto-generates the --help.

@jdub
Copy link
Contributor

jdub commented Nov 4, 2016

I'm going to send a quick PR to fix some inaccuracies in the current --help, but I can see it needs more love. If you have a preference either way for docopt / clap, I'd be happy to plug one in.

@Yamakaky
Copy link
Contributor

Yamakaky commented Nov 4, 2016

The only thing I have against clap is that the matches are basically a Map<String, String>, while docopt auto-deserialize in a struct.

@jdub
Copy link
Contributor

jdub commented Nov 4, 2016

Looks like we'd be stuck with that style of interface either way for now, as docopt depends on a compiler plugin to deserialise into a struct, doesn't yet support custom derive, and I suspect Macros 1.1 might not land as soon as we'd hoped anyway.

I'll get started with docopt.

jdub added a commit to jdub/rust-bindgen that referenced this issue Nov 4, 2016
Fixes rust-lang#87.

- Tidy up usage string
- Switch to using bindgen::Builder directly in main()
- Builder required some new methods
- `--use-msvc-mangling` appears to be deprecated, and is only referenced
in `src/lib.rs`. I have added a Deprecated section to the usage string
so using the flag doesn't cause errors
- `--emit-clang-ast` doesn't currently disable output of Rust bindings,
might have to do something tricky here
- Added `--version` based on CARGO_PKG_*
- Need to add some error handling to `<input-header>`
jdub added a commit to jdub/rust-bindgen that referenced this issue Nov 4, 2016
Fixes rust-lang#87.

- Tidy up usage string
- Switch to using bindgen::Builder directly in main()
- Builder required some new methods
- `--use-msvc-mangling` appears to be deprecated, and is only referenced
in `src/lib.rs`. I have added a Deprecated section to the usage string
so using the flag doesn't cause errors
- `--emit-clang-ast` doesn't currently disable output of Rust bindings,
might have to do something tricky here
- Added `--version` based on CARGO_PKG_*
- Need to add some error handling to `<input-header>`
jdub added a commit to jdub/rust-bindgen that referenced this issue Nov 4, 2016
Fixes rust-lang#87.

- Tidy up usage string
- Switch to using bindgen::Builder directly in main()
- Builder required some new methods
- `--use-msvc-mangling` appears to be deprecated, and is only referenced
in `src/lib.rs`. I have added a Deprecated section to the usage string
so using the flag doesn't cause errors
- `--emit-clang-ast` doesn't currently disable output of Rust bindings,
might have to do something tricky here
- Added `--version` based on CARGO_PKG_*
- Need to add some error handling to `<input-header>`
@jdub
Copy link
Contributor

jdub commented Nov 16, 2016

This can be resolved, as I reintroduced docopt… and then switched to clap in #228. 😂

@emilio emilio closed this as completed Nov 16, 2016
@emilio
Copy link
Contributor Author

emilio commented Nov 16, 2016

Right, thanks!

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

No branches or pull requests

4 participants