tests/user_commands/management/commands/required_list_option.py
raw| 1 | from django.core.management.base import BaseCommand |
| 2 | |
| 3 | |
| 4 | class Command(BaseCommand): |
| 5 | def add_arguments(self, parser): |
| 6 | parser.add_argument("--foo-list", nargs="+", type=int, required=True) |
| 7 | |
| 8 | def handle(self, *args, **options): |
| 9 | for option, value in options.items(): |
| 10 | self.stdout.write("%s=%s" % (option, value)) |