Exports data from optparse-based manage.py commands and reports it to pycharm.django_manage_obtainer._XmlDumper
"""
from optparse import Option
+import django
+from django.apps import registry
+from django.conf import settings
from django.core.management import ManagementUtility, get_commands, BaseCommand
__author__ = 'Ilya.Kazakevich'
command = utility.fetch_command(command_name)
assert isinstance(command, BaseCommand)
dumper.start_command(command_name=command_name,
- command_help_text=str(command.help),
+ command_help_text=str(command.usage("").replace("%prog", command_name)), # TODO: support subcommands
command_args_text=str(command.args))
for opt in command.option_list:
opt_type = opt.type if opt.type in Option.TYPES else "" # Empty for unknown
short_opt_names=opt._short_opts,
help_text=opt.help,
num_of_args=opt.nargs)
- dumper.close_command()
+ dumper.close_command()
\ No newline at end of file