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 YAML args. #267

Closed
XAMPPRocky opened this issue Sep 22, 2015 · 10 comments
Closed

Add documentation for YAML args. #267

XAMPPRocky opened this issue Sep 22, 2015 · 10 comments
Labels
A-docs Area: documentation, including docs.rs, readme, examples, etc...

Comments

@XAMPPRocky
Copy link

I can't really find anything about how to do certain commands using YAML.

Example:
subcommands_negate_reqs I tried adding it to the YAML file, and got the following error.

thread '<main>' panicked at 'Unknown Arg setting 'subcommands_negate_reqs' in YAML file for arg 'languages'', /Users/aaron/.multirust/toolchains/stable/cargo/registry/src/git.luolix.top-0a35038f75765ae4/clap-1.4.0/src/args/arg.rs:227
@Vinatorul Vinatorul added P2: need to have A-docs Area: documentation, including docs.rs, readme, examples, etc... labels Sep 22, 2015
@sru
Copy link
Contributor

sru commented Sep 22, 2015

@Aaronepower Did you try subcommandsNegateReqs? For now, you can use examples/17_yaml.rs and examples/17_yaml.yml as reference.

@XAMPPRocky
Copy link
Author

No, but why would it be camelCase? Every other command like takes_value is snake_case?

On Tue, Sep 22, 2015 at 5:31 PM, SungRim Huh notifications@github.com
wrote:

@Aaronepower Did you try subcommandsNegateReqs? For now, you can use examples/17_yaml.rs and examples/17_yaml.yml as reference.

Reply to this email directly or view it on GitHub:
#267 (comment)

@sru
Copy link
Contributor

sru commented Sep 22, 2015

@Aaronepower Or, SubcommandsNegateReqs. It is case insensitive. I am not sure about the exact decision.

SubcommandsNegateReqs is an AppSetting, not Arg setting, so you cannot set this for individual arguments. I've briefly looked at your yaml file. I think this is not what you want because flags are not subcommands. You probably want conflicts_with, or in yaml:

conflicts_with:
  - input

@kbknapp
Copy link
Member

kbknapp commented Sep 22, 2015

@Aaronepower It's camel case as part of the settings only because it's a bi-product of how AppSettings works, so actually case-insensitive should work too (just not snake case).

See here for an example.

EDIT: Also you can see the 17_yaml.rs and 17_yaml.yml for some other examples.

@sru
Copy link
Contributor

sru commented Sep 23, 2015

@kbknapp documentation has not been updated for ~2 weeks. I couldn't find the from_yaml function....

@Vinatorul
Copy link
Contributor

@sru it is updating with every Travis run on master
from_yaml does not present because docs are compiling without --features flag

UPD: I'll fix it in seconds

@WildCryptoFox
Copy link

@sru don't forget grep is you friend. 😉

@Vinatorul
Copy link
Contributor

@james-darkfox only on master branch

@WildCryptoFox
Copy link

@Vinatorul I just noticed you said "run on master" and just edited away that section of my comment. Thanks for confirming. :-)

@Vinatorul
Copy link
Contributor

I think #276 closes this issue. All yaml docs are on gh-pages
http://kbknapp.github.io/clap-rs/clap/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation, including docs.rs, readme, examples, etc...
Projects
None yet
Development

No branches or pull requests

5 participants