0

There are three arguments: A, B, C. How can I use argparse to allow for any two of them to be set and return an error if all three are set?

If I use the method add_mutually_exclusive_group, then I think I can only set one and only one of the three arguments. Is there a way to overcome this?

Stefano
  • 359
  • 1
  • 5
  • 16
  • 1
    You can follow a similar example here: https://stackoverflow.com/a/16524600/674039 – wim Jan 09 '20 at 23:00
  • I don't think `argparse` can do this by itself, you'll need to check that condition yourself. – Barmar Jan 09 '20 at 23:01
  • Didn't you find the `add_any_2_outof_3_group` command in the docs? :) Some tests are just too specialize to include in a general purpose tool. – hpaulj Jan 09 '20 at 23:54

0 Answers0