From 9da20483b8aa26a3090093212d007e6dc756b2d2 Mon Sep 17 00:00:00 2001 From: zlg Date: Sat, 6 Oct 2018 22:28:40 -0700 Subject: cli: Add "delete" command Unlike the old version of vgstash, the new one does not accept row IDs as arguments for removal. Instead, it accepts two mandatory arguments: the title of the game, and the system it's on. This is in line with the database itself, using the title and system as primary keys. --- src/vgstash_cli.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/vgstash_cli.py') diff --git a/src/vgstash_cli.py b/src/vgstash_cli.py index 39d2454..f88187c 100644 --- a/src/vgstash_cli.py +++ b/src/vgstash_cli.py @@ -129,3 +129,13 @@ def list_games(filter, raw, width): else: row_format(r, width, first_pass) first_pass = False + + +@cli.command('delete') +@click.argument('title', required=True) +@click.argument('system', required=True) +def delete_game(title, system): + db = get_db() + target_game = vgstash.Game(title, system) + if db.delete_game(target_game): + click.echo("Removed {} for {} from your collection.".format(title, system)) -- cgit v1.2.3-54-g00ecf e class='tabs'> aboutsummaryrefslogtreecommitdiff
path: root/ch5/5-08_error-checking.c (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2015-12-19Change license to GPLv3, add contributing guidezlg6-26/+834
* Improve README tone * Add `astylerc` for use with the astyle package * Add AUTHORS file to acknowledge contributors
2015-12-19Re-solve Exercise 1-16: arbitrarily long maxlineIsa Hassen1-44/+60
A completely rewritten solution which follows the spec given in the book exactly; make the program work for arbitrarily long input lines while modifying `main()` only. I've only changed the name of the macro MAXLINE to BUFFSIZE for clarity - otherwise the code is typed up exactly as found in the book. It demonstrates the use of a buffer without modifying any of the helper functions.