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

add crate_authors! macro #447

Closed
rtaycher opened this issue Mar 11, 2016 · 6 comments · Fixed by #482
Closed

add crate_authors! macro #447

rtaycher opened this issue Mar 11, 2016 · 6 comments · Fixed by #482
Labels
C-enhancement Category: Raise on the bar on expectations

Comments

@rtaycher
Copy link
Contributor

Once rust-lang/cargo#2465 lands it would be useful to have a crate_authors! macro to complement the crate_version! macro (fetch authors from cargo).

It's a pretty small change.

master...rtaycher:add_authors_macro

But it won't work on old cargo binaries.

Should I put this behind feature flags(at first)?

@kbknapp
Copy link
Member

kbknapp commented Mar 12, 2016

Awesome idea! I'm ok with not using feature flags, so long as the minimal version of cargo for this macro is annotated in the documentation. Thanks 👍

@kbknapp kbknapp added C-enhancement Category: Raise on the bar on expectations D: easy labels Mar 12, 2016
@sru
Copy link
Contributor

sru commented Mar 12, 2016

Since the environment variable is new, we could provide two versions of macros: One is just using env! (which will emit compilation error if the environment variable is not found), and other using option_env! and let user provide default authors if the environment variable is not found.

@rtaycher
Copy link
Contributor Author

I thought about using option_env! instead but then you get something that will need to be deprecated or be awkward later on.

Also to clarify technically it's newer then new, it hasn't been merged yet though I think it will be soon. I was thinking about adding a feature flag then dropping the flag after a year.

@sru
Copy link
Contributor

sru commented Mar 12, 2016

@rtaycher I guess it can get awkward after a while.

Once the pr is merged, can you amend the commit messages to follow the contribution guideline and make a pull request?

@kbknapp
Copy link
Member

kbknapp commented Mar 13, 2016

So yeah let's us a feature flag until it's in stable Rust. Whether that's the unstable flag or another one devoted to just this feature is the same to me.

@TheNeikos
Copy link

I find it funny, it's exactly for this use case that I proposed that change on rust/cargo 😄

rtaycher added a commit to rtaycher/clap-rs that referenced this issue Apr 11, 2016
Adds a crate_authors! macro that fetches
crate authors from a (recently added)
cargo enviromental variable populated
from the Cargo file. Like the
crate_version macro.

Closes clap-rs#447
homu added a commit that referenced this issue Apr 17, 2016
feat(Authors Macro): adds a crate_authors macro

Adds a crate_authors! macro that fetches
crate authors from a (recently added)
cargo enviromental variable populated
from the Cargo file. Like the
crate_version macro.

Closes #447

Hopefully this fixed the previous problems.
homu added a commit that referenced this issue Apr 17, 2016
feat(Authors Macro): adds a crate_authors macro

Adds a crate_authors! macro that fetches
crate authors from a (recently added)
cargo enviromental variable populated
from the Cargo file. Like the
crate_version macro.

Closes #447

Hopefully this fixed the previous problems.
@homu homu closed this as completed in #482 Apr 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Raise on the bar on expectations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants