Skip to content

Conversation

@derekbekoe
Copy link
Contributor

Closes #74

```Python
with ArgumentContext('foo') as c:
  c.argument('arg1', options_list=['--this'])

with ArgumentContext('foo bar') as c:
   c.ignore('arg1')
   c.argument('arg2', options_list=['--this'])
```

I will get an error because, although arg1 would be ignored, argparse sees a name conflict between arg1 and arg2.  If the ignore method automatically changed the options_list to something else `--__ARG1` for instance, then it won't produce the conflict and avoids me having to do this:

```Python
with ArgumentContext('foo') as c:
  c.argument('arg1', options_list=['--this'])

with ArgumentContext('foo bar') as c:
   c.argument('arg1', ignore_type, options_list=['--literally-anything-else'])
   c.argument('arg2', options_list=['--this'])
```
@derekbekoe derekbekoe merged commit 803c4cc into microsoft:master Mar 16, 2018
@derekbekoe derekbekoe deleted the ignore-arg branch March 16, 2018 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants