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 documentation for env #221

Merged
merged 2 commits into from Jul 19, 2019
Merged

Add documentation for env #221

merged 2 commits into from Jul 19, 2019

Conversation

vmalloc
Copy link
Contributor

@vmalloc vmalloc commented Jul 15, 2019

No description provided.

Copy link

@kaj kaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and simple. Apart from two minor issues, I think this looks just fine (I'm not the maintainer, though).

src/lib.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@kaj
Copy link

kaj commented Jul 15, 2019

By the way, maybe the flag hide_env_values (useful to avoid printing out sensitive data from environment in help messages) should also be mentioned here.

@vmalloc
Copy link
Contributor Author

vmalloc commented Jul 15, 2019

@kaj I didn't know that one! Couldn't find it in the source though. Can you point me to a resource detailing it?

@kaj
Copy link

kaj commented Jul 15, 2019

@kaj I didn't know that one! Couldn't find it in the source though. Can you point me to a resource detailing it?

It's listed at https://docs.rs/clap/2.33.0/clap/struct.Arg.html#method.hide_env_values (but the actual documentation is marked as TODO). I use it in a project and it works fine.

@vmalloc
Copy link
Contributor Author

vmalloc commented Jul 15, 2019

@kaj I'm not sure I get what that does... Using env by default does not output the value being used anywhere... what does that hide exactly?

@kaj
Copy link

kaj commented Jul 15, 2019

@kaj I'm not sure I get what that does... Using env by default does not output the value being used anywhere... what does that hide exactly?

It does, in the --help output. Try the example given in this crate:

env RETRIES=7 cargo run --example=env -- --help

@vmalloc
Copy link
Contributor Author

vmalloc commented Jul 15, 2019

@kaj ooooh I see. Ok, will add it then

@vmalloc
Copy link
Contributor Author

vmalloc commented Jul 15, 2019

@kaj I added documentation for hide_env_values

@TeXitoi
Copy link
Owner

TeXitoi commented Jul 19, 2019

Thanks for the contribution!

Note that this is pure clap documentation, and I generally avoid to doubling this documentation. But env is a frequently asked feature, thus I'm OK to put it here.

@TeXitoi TeXitoi merged commit 94946c3 into TeXitoi:master Jul 19, 2019
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.

None yet

3 participants