I am trying to create a Django control command using argparse, however, whenever I run it, it always returns the option that is valid, since this message comes from the manage.py file:
class Command(BaseCommand): def handle(self, *args, **options): parser = argparse.ArgumentParser('Parsing arguments') parser.add_argument('--max', type=float, store) args = parser.parse_args(sys.argv[2:])
What would be the correct way to use the argument parser with control commands?
Python version 2.x.
source share