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

Switch cli arg parsing from structopt to clap #245

Merged
merged 2 commits into from
Aug 1, 2020
Merged

Switch cli arg parsing from structopt to clap #245

merged 2 commits into from
Aug 1, 2020

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Jul 31, 2020

This eliminates several dependencies (heck, proc-macro-error, proc-macro-error-attr, structopt, structopt-derive, syn-mid, unicode-segmentation) and makes it somewhat more natural to exercise more control over the help output.

Before:

cxxbridge 0.3.4
David Tolnay <[email protected]>
https://github.com/dtolnay/cxx

USAGE:
    cxxbridge <input>.rs              Emit .cc file for bridge to stdout
    cxxbridge <input>.rs --header     Emit .h file for bridge to stdout
    cxxbridge --header                Emit rust/cxx.h header to stdout

FLAGS:
    -h, --help       Print help information
        --header     Emit header with declarations only
    -V, --version    Print version information

OPTIONS:
        --cxx-impl-annotations <cxx-impl-annotations>
            Optional annotation for implementations of C++ function wrappers that may be exposed to Rust. You may for
            example need to provide __declspec(dllexport) or __attribute__((visibility("default"))) if Rust code from
            one shared object or executable depends on these C++ functions in another
    -i, --include <include>...                           Any additional headers to #include

ARGS:
    <input>    Input Rust source file containing #[cxx::bridge]

After:

cxxbridge 0.3.4
David Tolnay <[email protected]>
https://github.com/dtolnay/cxx

USAGE:
    cxxbridge <input>.rs              Emit .cc file for bridge to stdout
    cxxbridge <input>.rs --header     Emit .h file for bridge to stdout
    cxxbridge --header                Emit rust/cxx.h header to stdout

ARGS:
    <input>
            Input Rust source file containing #[cxx::bridge].

OPTIONS:
        --cxx-impl-annotations <annotation>
            Optional annotation for implementations of C++ function wrappers
            that may be exposed to Rust. You may for example need to provide
            __declspec(dllexport) or __attribute__((visibility("default")))
            if Rust code from one shared object or executable depends on
            these C++ functions in another.

    -h, --help
            Print help information.

        --header
            Emit header with declarations only.

    -i, --include <include>...
            Any additional headers to #include. The cxxbridge tool does not
            parse or even require the given paths to exist; they simply go
            into the generated C++ code as #include lines.

    -V, --version
            Print version information.

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.

1 participant