diff --git a/geomagio/processing/copy_absolutes.py b/geomagio/processing/copy_absolutes.py index b2398b027a56df15e2aeaed2b2523ff1ba3ad122..86d0748c591c375656d630f674806ac1bd2f1752 100644 --- a/geomagio/processing/copy_absolutes.py +++ b/geomagio/processing/copy_absolutes.py @@ -58,6 +58,10 @@ def copy_absolutes( help="Residual spreadsheet directory", ), factory: ResidualFactory = ResidualFactory.WEB_ABSOLUTES, + force: bool = typer.Option( + default=False, + help="Force skip the check to copy absolutes", + ), ): """Copy absolutes from the web absolutes service OR residual spreadsheets into the metadata service.""" if factory.value == ResidualFactory.WEB_ABSOLUTES: @@ -73,12 +77,11 @@ def copy_absolutes( ) # confirm whether or not to copy absolutes - print(f"Found {len(readings)} absolutes") - copy = typer.confirm(f"Are you sure you want to copy {len(readings)} absolutes?") - if not copy: - print("Not copying absolutes") - raise typer.Abort() - print("Copying over absolutes") + if not force: + typer.confirm( + f"Are you sure you want to copy {len(readings)} absolutes?", abort=True + ) + print("Copying over absolutes") # write readings to metadata service metadata_factory = MetadataFactory(token=metadata_token, url=metadata_url)