dtolnay / gflags

Command line flags library that does not require a central list of all the flags
Apache License 2.0
54 stars 6 forks source link

Add build option to use C++ gflags as backend #6

Open dtolnay opened 5 years ago

dtolnay commented 5 years ago

The pure Rust implementation is good as a default, but it would be amazing to also provide:

[dependencies]
gflags = { version = "0.N", features = ["interop"] }

in which everything looks and behaves the same at the Rust source code level but the implementation switches to exactly the one used by C++ gflags, so that flags defined in Rust are seen by a C++ main function and vice versa.

Unsure whether this is possible.

KinanBab commented 2 years ago

I think this may be possible. I was hoping this would actually be the case for a project I am working on which involves a bunch of rust/c++ FFI with different command line arguments.

I am a bit swamped right now with work. But I will try to come back to this in a month or so and see if I can implement this and give you a PR.