Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7122970
D7343.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
856 B
Subscribers
None
D7343.diff
View Options
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
Details
Attached
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
Attached To
D7343: Add a --non-interactive flag to the `swh db upgrade` command
Event Timeline
Log In to Comment