Fixed #19973 -- Replaced optparse by argparse in management commands

unsure about calling it a "class method" since it's not `@classmethod`?