cli: make devscripts subcommand more accessible #18
@ -7,6 +7,7 @@ from sqlalchemy.orm import Session
|
||||
from .services import (
|
||||
Config,
|
||||
arg_parser,
|
||||
devscripts_arg_parser,
|
||||
)
|
||||
|
||||
from .deadline_daemon import DeadlineDaemon
|
||||
@ -69,7 +70,7 @@ def main():
|
||||
from .devscripts.seed_test_data import main
|
||||
main(sql_session)
|
||||
else:
|
||||
print(f'Error: no such script: {args.script}')
|
||||
print(devscripts_arg_parser.format_help())
|
||||
exit(1)
|
||||
exit(0)
|
||||
|
||||
@ -83,4 +84,5 @@ def main():
|
||||
flask_prod_main()
|
||||
exit(0)
|
||||
|
||||
print(arg_parser.format_help())
|
||||
print(arg_parser.format_help())
|
||||
exit(1)
|
@ -1,4 +1,7 @@
|
||||
from .argument_parser import arg_parser
|
||||
from .argument_parser import (
|
||||
arg_parser,
|
||||
devscripts_arg_parser,
|
||||
)
|
||||
from .bookcase_item import (
|
||||
create_bookcase_item_from_isbn,
|
||||
is_valid_isbn,
|
||||
|
@ -31,12 +31,17 @@ subparsers.add_parser(
|
||||
help = 'Start the web interface in production mode',
|
||||
)
|
||||
|
||||
subparsers.add_parser(
|
||||
'devscripts',
|
||||
help = 'Run development scripts',
|
||||
).add_argument(
|
||||
'script',
|
||||
help = 'The development script to run',
|
||||
devscripts_arg_parser = subparsers.add_parser('devscripts', help='Run development scripts')
|
||||
devscripts_subparsers = devscripts_arg_parser.add_subparsers(dest='script')
|
||||
|
||||
devscripts_subparsers.add_parser(
|
||||
'seed-test-data',
|
||||
help = 'Seed test data in the database',
|
||||
)
|
||||
|
||||
devscripts_subparsers.add_parser(
|
||||
'seed-content-for-deadline-daemon',
|
||||
help = 'Seed data tailorded for testing the deadline daemon, into the database',
|
||||
)
|
||||
|
||||
arg_parser.add_argument(
|
||||
|
Loading…
Reference in New Issue
Block a user