From ebc68d3c367c22c29c7aadaf28081d0474718762 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 6 May 2019 23:50:28 -0400 Subject: [PATCH] Add arguments to the preparestatic command Signed-off-by: Roberto Rosario --- .../management/commands/preparestatic.py | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/mayan/apps/appearance/management/commands/preparestatic.py b/mayan/apps/appearance/management/commands/preparestatic.py index 36743074d2..e3839714f1 100644 --- a/mayan/apps/appearance/management/commands/preparestatic.py +++ b/mayan/apps/appearance/management/commands/preparestatic.py @@ -12,10 +12,37 @@ IGNORE_LIST = [ class Command(management.BaseCommand): - help = 'Call the collectstatic command with some sane defaults.' + help = 'Call the collectstatic command with some specific defaults.' + + def add_arguments(self, parser): + parser.add_argument( + '--noinput', '--no-input', + action='store_false', dest='interactive', default=True, + help='Do NOT prompt the user for input of any kind.', + ) + parser.add_argument( + '-n', '--dry-run', + action='store_true', dest='dry_run', default=False, + help='Do everything except modify the filesystem.', + ) + parser.add_argument( + '-c', '--clear', + action='store_true', dest='clear', default=False, + help='Clear the existing files using the storage ' + 'before trying to copy or link the original file.', + ) + parser.add_argument( + '-l', '--link', + action='store_true', dest='link', default=False, + help='Create a symbolic link to each file instead of copying.', + ) def handle(self, *app_labels, **options): management.call_command( - command_name='collectstatic', ignore=IGNORE_LIST, - clear=True + command_name='collectstatic', + clear=options['clear'], + dry_run=options['dry_run'], + ignore=IGNORE_LIST, + interactive=options['interactive'], + link=options['link'], )