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

App::with_defaults pulls clap's author and version #638

Closed
guiniol opened this issue Aug 28, 2016 · 13 comments
Closed

App::with_defaults pulls clap's author and version #638

guiniol opened this issue Aug 28, 2016 · 13 comments
Labels
A-builder Area: Builder API C-bug Category: Updating dependencies E-hard Call for participation: Experience needed to fix: Hard / a lot

Comments

@guiniol
Copy link

guiniol commented Aug 28, 2016

Using the new App:with_defaults displays clap's author and version number.
This is with clap version 2.11.0

@kbknapp
Copy link
Member

kbknapp commented Aug 28, 2016

Interesting, I hadn't thought about that happenig. Thanks for reporting!

@kbknapp kbknapp added C-bug Category: Updating dependencies P1: urgent A-builder Area: Builder API labels Aug 28, 2016
@kbknapp kbknapp added this to the 2.11.1 milestone Aug 28, 2016
@kbknapp kbknapp modified the milestones: 2.12.0, 2.11.1 Sep 5, 2016
@homu homu closed this as completed in b3efc10 Sep 5, 2016
@clux
Copy link

clux commented Sep 7, 2016

This still happens in 2.11.2, maybe that commit was meant to close #643 instead?

@kbknapp
Copy link
Member

kbknapp commented Sep 8, 2016

@clux yes, that was a mistake. Thanks!

@kbknapp kbknapp reopened this Sep 8, 2016
@kbknapp kbknapp removed this from the 2.12.0 milestone Sep 10, 2016
@kbknapp kbknapp added E-hard Call for participation: Experience needed to fix: Hard / a lot and removed D: easy labels Sep 12, 2016
@kbknapp
Copy link
Member

kbknapp commented Oct 9, 2016

From @RoPP

Cargo.toml :

[package]
name = "plop"
version = "0.1.0"
authors = ["Plop <plop@plop.net>"]

[dependencies]
clap = "2.9"

src/main.rs :

extern crate clap;
use clap::App;

fn main() {
    App::with_defaults("plop").get_matches();
}
cargo run -- --help
     Running `target/debug/plop --help`
Plop 2.14.0        <-------------------
Kevin K. <kbknapp@gmail.com>  <--------

USAGE:
    plop

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

@nabijaczleweli
Copy link
Contributor

nabijaczleweli commented Oct 15, 2016

After a couple of iterations I've approached this from a different angle: what if instead the above src/main.rs looked like this:

#[macro_use]
extern crate clap;
use clap::App;

fn main() {
    defaulted_app!("plop").get_matches();
}

Name to be improved, of course.

@kbknapp
Copy link
Member

kbknapp commented Oct 16, 2016

@nabijaczleweli perhaps. I'm not against that, but also don't want to confuse people with the clap_app! macro, or macro builders.

At this point, I'm also not really against simply deprecating App::with_defaults as broken until we can decide something more elegant during the v3 build up. Because I think the with_defaults doesn't add a whole ton, and can be very easily worked around by using crate_version! and crate_authors!

@nabijaczleweli
Copy link
Contributor

App::with_defaults() in its current state has 100% no chance of working and tbh I don't really see its value, either.

@kbknapp
Copy link
Member

kbknapp commented Oct 16, 2016

Agreed.

homu added a commit that referenced this issue Oct 17, 2016
…te, r=kbknapp

Deprecate App::with_defaults()

Closes #638
homu added a commit that referenced this issue Oct 17, 2016
…te, r=kbknapp

Deprecate App::with_defaults()

Closes #638
@homu homu closed this as completed in #692 Oct 17, 2016
@rtaycher
Copy link
Contributor

rtaycher commented Oct 28, 2016

Darn it, I guess if it doesn't work it doesn't work.

Can I make a ticket to discuss a redesign for v3?

@kbknapp
Copy link
Member

kbknapp commented Oct 28, 2016

Yeah its deprecated as basically unfixable at this time. :(

On Oct 28, 2016 7:26 AM, "Roman A. Taycher" notifications@github.com
wrote:

Darn it, I guess if it doesn't work it doesn't work.


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#638 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGntttf68UczkpzFhPLif23H984eG0U1ks5q4dvNgaJpZM4Ju5rb
.

@rtaycher
Copy link
Contributor

rtaycher commented Nov 1, 2016

It's because it pulls the info from the compilation of the clap-rs crate right?

And a macro like @nabijaczleweli proposed would work, right?

I was wondering if I could start a ticket to discuss re-design or if there's another place I could put it(forum?)?

I had some other ideas, like possibly putting CARGO_PKG_DESCRIPTION in about.

@kbknapp
Copy link
Member

kbknapp commented Nov 1, 2016

@rtaycher I'm all for opening an issue/PR which either fixes this, or discusses new ways to accomplish it. There are just other issues which are are a higher priority for myself right now, but if you'd like to open the discussion and try out some fixes I'm all for it 👍

@ishitatsuyuki
Copy link

#778

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builder Area: Builder API C-bug Category: Updating dependencies E-hard Call for participation: Experience needed to fix: Hard / a lot
Projects
None yet
Development

No branches or pull requests

6 participants