2019-04-22 17:36:27 +00:00
|
|
|
__package__ = 'archivebox'
|
|
|
|
|
2019-04-02 20:36:41 +00:00
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
|
|
|
|
|
2019-04-22 17:36:27 +00:00
|
|
|
from .cli import run_subcommand
|
2019-04-02 22:53:21 +00:00
|
|
|
|
2019-04-02 20:36:41 +00:00
|
|
|
|
|
|
|
class Command(BaseCommand):
|
2019-04-22 17:36:27 +00:00
|
|
|
help = 'Run an ArchiveBox CLI subcommand (e.g. add, remove, list, etc)'
|
|
|
|
|
|
|
|
def add_arguments(self, parser):
|
|
|
|
parser.add_argument('subcommand', type=str, help='The subcommand you want to run')
|
|
|
|
parser.add_argument('command_args', nargs='*', help='Arguments to pass to the subcommand')
|
|
|
|
|
2019-04-02 20:36:41 +00:00
|
|
|
|
|
|
|
def handle(self, *args, **kwargs):
|
2019-04-22 17:36:27 +00:00
|
|
|
run_subcommand(kwargs['subcommand'], args=kwargs['command_args'])
|