Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7437762
D813.id2586.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D813.id2586.diff
View Options
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
Details
Attached
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
Attached To
D813: core.cli: Fix the create option as flag
Event Timeline
Log In to Comment