diff --git a/setup.py b/setup.py index 4831447..0c18f50 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='todoism', - version='1.19', + version='1.20', packages=find_packages(exclude=['test']), package_dir={'todoism': 'todoism'}, entry_points={ diff --git a/todoism/cli.py b/todoism/cli.py index ee29331..f692201 100644 --- a/todoism/cli.py +++ b/todoism/cli.py @@ -7,6 +7,7 @@ def parse_args(): parser.add_argument("-d", "--delete", metavar="ID", type=validate_id, help="delete todo by id") parser.add_argument("-p", "--print-all", action="store_true", help="print all todos") parser.add_argument("-f", "--flag", action="store_true", help="set task as flagged (used with '-a')") + parser.add_argument("-v", "--version", action="store_true", help="show todoism version") return parser.parse_args() def validate_id(arg): diff --git a/todoism/main.py b/todoism/main.py index 10b2638..c24ff0e 100644 --- a/todoism/main.py +++ b/todoism/main.py @@ -221,6 +221,8 @@ def run(): elif args.print_all: todos = tsk.load_tasks() pr.print_all_cli(todos) + elif args.version: + pr.print_version() else: curses.wrapper(main) diff --git a/todoism/print.py b/todoism/print.py index f88f17b..fe50373 100644 --- a/todoism/print.py +++ b/todoism/print.py @@ -53,6 +53,9 @@ def print_msg(stdscr, msg): stdscr.addstr(1, 0, f"{final_str}") stdscr.refresh() +def print_version(): + print("todoism version 1.20") + # The core function to print a single task def print_task(stdscr, task, y): max_y, max_x= stdscr.getmaxyx()