new setup flag on init command to autosetup on init

This commit is contained in:
Nick Sweeting 2021-04-05 21:15:32 -04:00
parent 5c181532b5
commit 8b4f84959a
3 changed files with 26 additions and 13 deletions

View file

@ -15,10 +15,10 @@ from importlib import import_module
CLI_DIR = Path(__file__).resolve().parent
# these common commands will appear sorted before any others for ease-of-use
meta_cmds = ('help', 'version') # dont require valid data folder at all
main_cmds = ('init', 'config') # dont require existing db present
archive_cmds = ('add', 'remove', 'update', 'list', 'status', 'setup') # require existing db present
fake_db = ("oneshot",) # use fake in-memory db
meta_cmds = ('help', 'version') # dont require valid data folder at all
main_cmds = ('init', 'config', 'setup') # dont require existing db present
archive_cmds = ('add', 'remove', 'update', 'list', 'status') # require existing db present
fake_db = ("oneshot",) # use fake in-memory db
display_first = (*meta_cmds, *main_cmds, *archive_cmds)

View file

@ -32,12 +32,18 @@ def main(args: Optional[List[str]]=None, stdin: Optional[IO]=None, pwd: Optional
action='store_true',
help='Run any updates or migrations without rechecking all snapshot dirs',
)
parser.add_argument(
'--setup', #'-s',
action='store_true',
help='Automatically install dependencies and extras used for archiving',
)
command = parser.parse_args(args or ())
reject_stdin(__command__, stdin)
init(
force=command.force,
quick=command.quick,
setup=command.setup,
out_dir=pwd or OUTPUT_DIR,
)