-
Notifications
You must be signed in to change notification settings - Fork 23
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
paw compatibility + minor improv. #22
Conversation
paw = { version = "1.0", optional = true } | ||
|
||
[features] | ||
default = [] | ||
paw-compatibility = ["paw"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had an error to use this library in combination with structopt + paw, so I added paw as an optional dependency behind a feature.
How does having a paw
dependency fix our support for paw
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added one demonstration as a new commentary, and I'm also now repeating what I placed in there, but I think that this is the case because on how structopt macros references paw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These patches do not change anything.
Sorry to say, but I'd reject this.
I admit that this is surprising, but it does make a difference. git clone https://github.com/swfsql/clap-comp-example.git
cd clap-comp-example
git checkout afce9fd
cargo check
git checkout 89594fe
cargo check
git diff afce9fd The main is just: #[derive(structopt::StructOpt)]
struct Args {
#[structopt(flatten)]
verbose: clap_verbosity_flag::Verbosity,
}
#[paw::main]
fn main(args: Args) {} The initial Cargo.toml is: [package]
name = "example-a"
version = "0.1.0"
authors = ["Thi <swfsql@gmail.com.br>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
paw = "1.0.0"
structopt = { version = "0.3.0", features = ["paw"] }
[dependencies.clap-verbosity-flag]
version = "0.3.1" (which fails to compile) The final Cargo.toml is: [package]
name = "example-a"
version = "0.1.0"
authors = ["Thi <swfsql@gmail.com.br>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
paw = "1.0.0"
structopt = { version = "0.3.0", features = ["paw"] }
[dependencies.clap-verbosity-flag]
version = "0.3.1"
features = ["paw-compatibility"]
[patch.crates-io.clap-verbosity-flag]
git = "https://github.com/swfsql/clap-verbosity-flag"
rev = "d9f92b7" (which compiles), where in this I patched it to use the one from this PR. I think that this is the case because on how structopt macros references paw. |
Providing the error is helpful
So structopt has been configured with Personally, I wish macros had an option to run as if they were coming from their own crate because they make it easy to break abstractions, like here. Either structopt needs to re-export Created an issue over at TeXitoi/structopt#407 |
I see! Thanks for creating the issue for them. |
I had an error to use this library in combination with
structopt
+paw
, so I addedpaw
as an optional dependency behind a feature.Also added a minor improvement for
Verbosity::set_default
.