Skip to content

Use docopt for argument parsing #44

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

Merged
merged 1 commit into from
Aug 27, 2016

Conversation

fitzgen
Copy link
Member

@fitzgen fitzgen commented Aug 26, 2016

This commit switches bindgen over to using the docopt crate for argument parsing
instead of manual argument parsing. This required two notable changes in the
arguments and flags style:

  1. All flags of the form -foo are now of the form --foo.
  2. We can no longer pass unknown flags straight through to clang. Instead, the
    user appends -- after the bindgen flags and input header, after which point
    any more flags and arguments get collected and passed to clang. This required
    changes to the test runner and the // bindgen-flags comments.

r? @emilio

This commit switches bindgen over to using the docopt crate for argument parsing
instead of manual argument parsing. This required two notable changes in the
arguments and flags style:

1. All flags of the form `-foo` are now of the form `--foo`.

2. We can no longer pass unknown flags straight through to clang. Instead, the
user appends `--` after the bindgen flags and input header, after which point
any more flags and arguments get collected and passed to clang. This required
changes to the test runner and the `// bindgen-flags` comments.
[dependencies.quasi]
features = ["with-syntex"]
version = "0.15"

Copy link
Member Author

Choose a reason for hiding this comment

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

Using cargo add really goes to town with reformatting toml files... I can revert this and add the dependency manually, if you'd prefer.

@emilio
Copy link
Contributor

emilio commented Aug 27, 2016

Wohoo, thanks for doing this! :-)

I'll merge it, though now I'll have to rebase stuff and change scripts :P

@bors-servo: r+

@bors-servo
Copy link

📌 Commit 1826827 has been approved by emilio

@bors-servo
Copy link

⚡ Test exempted - status

@bors-servo bors-servo merged commit 1826827 into rust-lang:master Aug 27, 2016
bors-servo pushed a commit that referenced this pull request Aug 27, 2016
Use docopt for argument parsing

This commit switches bindgen over to using the docopt crate for argument parsing
instead of manual argument parsing. This required two notable changes in the
arguments and flags style:

1. All flags of the form `-foo` are now of the form `--foo`.

2. We can no longer pass unknown flags straight through to clang. Instead, the
user appends `--` after the bindgen flags and input header, after which point
any more flags and arguments get collected and passed to clang. This required
changes to the test runner and the `// bindgen-flags` comments.

r? @emilio
@Manishearth
Copy link
Member

This needs a corresponding PR to the servo side (regen.py), btw

@emilio
Copy link
Contributor

emilio commented Aug 27, 2016

Was the first thing I did a few hours ago: servo/servo#13079

Feel free to review it :P

@fitzgen
Copy link
Member Author

fitzgen commented Aug 27, 2016

Thanks for merging :)

Will need to update servo/rust-mozjs/etc/bindings.sh too -- I can do that after the smup lands.

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.

5 participants