Page MenuHomeSoftware Heritage

D813.id2586.diff
No OneTemporary

D813.id2586.diff

diff --git a/swh/core/cli.py b/swh/core/cli.py
--- a/swh/core/cli.py
+++ b/swh/core/cli.py
@@ -21,10 +21,11 @@
@click.argument('module', nargs=-1, required=True)
@click.option('--db-name', '-d', help='Database name.',
default='softwareheritage-dev', show_default=True)
-@click.option('--no-create', '-C',
- help='Do not attempt to create the database', default=False)
-def db_init(module, db_name=None, no_create=None):
- """Create and initialise a database for the Software Heritage <module>.
+@click.option('--create/--no-create', '-c',
+ help='Attempt to create the database', default=True)
+def db_init(module, db_name=None, create=True):
+ """Initialise a database for the Software Heritage <module>. By
+ default, attempts to create the database first.
Example:
@@ -58,7 +59,7 @@
'(no sql/ dir)'.format(modname))
dump_files.extend(sorted(glob.glob(path.join(sqldir, '*.sql')),
key=sortkey))
- if not no_create:
+ if create:
pg_createdb(db_name)
dump_files = [(x, DB_DUMP_TYPES[path.splitext(x)[1]])

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 14, 5:10 AM (13 h, 59 s ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3230742

Event Timeline