I accidentally used 'argparse' like this in my Python 3.9 program:
  parser.add_argument ("-c, --clean",  dest="clean", action="store_true")
  parser.add_argument ("-n, --dryrun", dest="dryrun", action="store_true")

instead of:
  parser.add_argument ("-c", "--clean",  dest="clean", action="store_true")
  parser.add_argument ("-n", "--dryrun", dest="dryrun", action="store_true")

So any use of 'my-prog.py -cn' threw an error:
  error: unrecognized arguments: -cn

So is there something that throws an error on this wrong use of
"-c, --clean" instead? Could be useful. Or is "-c, --clean" legit somehow?

--
--gv
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to