Permalink
Browse files

Show Command

Add simple command to view the details of individual tasks.
  • Loading branch information...
198d committed May 16, 2012
1 parent 93add7c commit 1bb9599de33549cf3e32fec7c6455939b68ab732
Showing with 30 additions and 0 deletions.
  1. +18 −0 README.md
  2. +12 −0 clask/cli.py
View
@@ -168,3 +168,21 @@ The ```--states``` option allows filtering the list by a set of
states. By default, finished tasks are not displayed. The
```--finished``` option will include those tasks. To see only finished
tasks, use the ```---states``` option.
+
+### Viewing individual tasks
+
+```
+usage: clask show [-h] slug
+
+Show the details of a task in the current clask project.
+
+positional arguments:
+ slug slug of the task to show
+
+optional arguments:
+ -h, --help show this help message and exit
+```
+
+This will show the details of the task specified by ```slug``` in the
+same way the ```list``` command shows tasks when run with
+```--format=long```.
View
@@ -54,6 +54,11 @@ def _filter(task_):
_display_task(task_, format_=format_)
+def show(args):
+ task_ = task.load(args.slug)
+ _display_task(task_, format_='long')
+
+
def finish(args):
args.state = 'finished'
move(args, finish=True)
@@ -138,5 +143,12 @@ def main():
help='format to display listed tasks (defualt: short)')
list_parser.set_defaults(func=list_)
+ show_parser = subparsers.add_parser('show',
+ help='Show the details of a task in the current clask project',
+ description='Show the details of a task in the current clask project.')
+ show_parser.add_argument('slug', help='slug of the task to show')
+ show_parser.set_defaults(func=show)
+
+
args = parser.parse_args()
args.func(args)

0 comments on commit 1bb9599

Please sign in to comment.