|
|
@@ -122,6 +122,21 @@ def new(ctx, **data):
|
|
|
click.echo(Term.failure(e.args[0]))
|
|
|
|
|
|
|
|
|
+@comment.command('new')
|
|
|
+@click.option('--text', prompt='Text')
|
|
|
+@click.option('--item_id', prompt='ID of the item to add comment to')
|
|
|
+@click.pass_context
|
|
|
+def new_comment(ctx, **data):
|
|
|
+ """Add new content"""
|
|
|
+ model = ctx.obj['model']
|
|
|
+ db = ctx.obj['db']
|
|
|
+ try:
|
|
|
+ instance = db.create(model, data)
|
|
|
+ click.echo(Term.success(instance))
|
|
|
+ except ValueError as e:
|
|
|
+ click.echo(Term.failure(e.args[0]))
|
|
|
+
|
|
|
+
|
|
|
@click.command('list')
|
|
|
@click.pass_context
|
|
|
def list(ctx):
|
|
|
@@ -134,7 +149,7 @@ def list(ctx):
|
|
|
click.echo(output.output_data(i))
|
|
|
|
|
|
|
|
|
-for group in [milestone, sprint, item, comment]:
|
|
|
+for group in [milestone, sprint, item]:
|
|
|
for command in [new, list]:
|
|
|
group.add_command(command)
|
|
|
|