Page MenuHomeSoftware Heritage

D7343.diff
No OneTemporary

D7343.diff

diff --git a/swh/core/cli/db.py b/swh/core/cli/db.py
--- a/swh/core/cli/db.py
+++ b/swh/core/cli/db.py
@@ -323,8 +323,13 @@
metavar="VERSION",
default=None,
)
+@click.option(
+ "--interactive/--non-interactive",
+ help="Do not ask questions (use default answer to all questions)",
+ default=True,
+)
@click.pass_context
-def db_upgrade(ctx, module, to_version):
+def db_upgrade(ctx, module, to_version, interactive):
"""Upgrade the database for given module (to a given version if specified).
Examples::
@@ -360,7 +365,7 @@
fg="yellow",
bold=True,
)
- if not click.confirm(
+ if interactive and not click.confirm(
f"Write the module information ({module}) in the database?", default=True
):
raise click.BadParameter("Migration aborted.")

File Metadata

Mime Type
text/plain
Expires
Dec 17 2024, 1:55 PM (11 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3223383

Event Timeline