|
@@ -19,6 +19,8 @@ meta_cmds = ('help', 'version')
|
|
|
main_cmds = ('init', 'info', 'config')
|
|
main_cmds = ('init', 'info', 'config')
|
|
|
archive_cmds = ('add', 'remove', 'update', 'list', 'status')
|
|
archive_cmds = ('add', 'remove', 'update', 'list', 'status')
|
|
|
|
|
|
|
|
|
|
+fake_db = ("oneshot",) + meta_cmds
|
|
|
|
|
+
|
|
|
display_first = (*meta_cmds, *main_cmds, *archive_cmds)
|
|
display_first = (*meta_cmds, *main_cmds, *archive_cmds)
|
|
|
|
|
|
|
|
# every imported command module must have these properties in order to be valid
|
|
# every imported command module must have these properties in order to be valid
|
|
@@ -59,7 +61,7 @@ def run_subcommand(subcommand: str,
|
|
|
pwd: Union[Path, str, None]=None) -> None:
|
|
pwd: Union[Path, str, None]=None) -> None:
|
|
|
"""Run a given ArchiveBox subcommand with the given list of args"""
|
|
"""Run a given ArchiveBox subcommand with the given list of args"""
|
|
|
from ..config import setup_django
|
|
from ..config import setup_django
|
|
|
- setup_django()
|
|
|
|
|
|
|
+ setup_django(in_memory_db=subcommand in fake_db)
|
|
|
|
|
|
|
|
module = import_module('.archivebox_{}'.format(subcommand), __package__)
|
|
module = import_module('.archivebox_{}'.format(subcommand), __package__)
|
|
|
module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: ignore
|
|
module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: ignore
|