I'm writing a custom django management command.
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(
"-i",
"--user_id",
dest="user_id",
),
make_option(
"-f",
"--fields",
dest="fields"
),
)
I need fields to consist of multiple elements. I know about nargs but I need to specify an exact number. My fields can vary from 1 to 5 elements. Is there a proper way to work with such args lists?