Skip to content

Commit

Permalink
Merge pull request #27 from greyli/fix-cli-test
Browse files Browse the repository at this point in the history
Update command names
  • Loading branch information
greyli authored Jun 12, 2024
2 parents f9d9e61 + 40107c4 commit 771bc9c
Show file tree
Hide file tree
Showing 6 changed files with 388 additions and 473 deletions.
8 changes: 4 additions & 4 deletions greybook/core/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@


def register_commands(app):
@app.cli.command()
@app.cli.command(name='init-db')
@click.option('--drop', is_flag=True, help='Create after drop.')
def initdb(drop):
def init_db(drop):
"""Initialize the database."""
if drop:
click.confirm(
Expand All @@ -24,7 +24,7 @@ def initdb(drop):
click.echo('Initialized the database.')


@app.cli.command()
@app.cli.command(name='init-blog')
@click.option('--username', prompt=True, help='The username used to login.')
@click.option(
'--password',
Expand All @@ -33,7 +33,7 @@ def initdb(drop):
confirmation_prompt=True,
help='The password used to login.'
)
def init(username, password):
def init_blog(username, password):
"""Initialize the blog."""

db.create_all()
Expand Down
Loading

0 comments on commit 771bc9c

Please sign in to comment.