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

Yaml Parsing of "conflicts_with" should be able to process a single value #614

Closed
Gilnaa opened this issue Aug 5, 2016 · 1 comment
Closed
Labels
C-bug Category: Updating dependencies
Milestone

Comments

@Gilnaa
Copy link

Gilnaa commented Aug 5, 2016

#513 Currently, when using the following yaml notation:

args:
    - verbose:
        short: v
        long: verbose
        help: Output verbose CLI output
        conflicts_with: quiet

    - quiet:
        short: q
        long: quiet
        help: Supress non-error messages.
        conflicts_with: verbose

the parsing will panic due to the following lines: (it is initially unclear as to why)

"conflicts_with" => {
                    for ys in v.as_vec().unwrap() {

The example says that:

# Conflicts, mutual overrides, and requirements can all be defined as a
# list, where the key is the name of the other argument

but it does not say that they must be defined as a list.

It is unclear whether this is a bug or not, but the example definitely misinforms the user as for the correct usage.

@kbknapp
Copy link
Member

kbknapp commented Aug 20, 2016

Thanks for pointing this out. I'll try to fix it in place, instead of just the docs, as I think your code example should work and not doing so is a bug.

@kbknapp kbknapp added C-bug Category: Updating dependencies P1: urgent labels Aug 20, 2016
@kbknapp kbknapp added this to the 2.10.1 milestone Aug 20, 2016
kbknapp added a commit that referenced this issue Aug 20, 2016
One can now use a list or single value for certain Arg YAML declarations
such as possible_values, etc.

Prior to this commit, if only a single value was desired one would have
to use the format:

```yaml
possible_values:
    - value
```

But now once can use

```yaml
possible_values: value
```

Closes #614
kbknapp added a commit that referenced this issue Aug 20, 2016
One can now use a list or single value for certain Arg YAML declarations
such as possible_values, etc.

Prior to this commit, if only a single value was desired one would have
to use the format:

```yaml
possible_values:
    - value
```

But now once can use

```yaml
possible_values: value
```

Closes #614
Closes #613
homu added a commit that referenced this issue Aug 20, 2016
feat(YAML): allows using lists or single values with arg declarations

One can now use a list or single value for certain Arg YAML declarations
such as possible_values, etc.

Prior to this commit, if only a single value was desired one would have
to use the format:

```yaml
possible_values:
    - value
```

But now once can use

```yaml
possible_values: value
```

Closes #614
Closes #613
@homu homu closed this as completed in #620 Aug 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Updating dependencies
Projects
None yet
Development

No branches or pull requests

2 participants