Commit dfb8dd77 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Fix synopsis and help for expression commands.

parent 11375943
...@@ -38,8 +38,16 @@ class DeleteCommand(DCommand): ...@@ -38,8 +38,16 @@ class DeleteCommand(DCommand):
self.execute_specific_core(p_todo) self.execute_specific_core(p_todo)
def usage(self): def usage(self):
return """Synopsis: del [-f] <NUMBER1> [<NUMBER2> ...]""" return """\
Synopsis: del [-f] <NUMBER1> [<NUMBER2> ...]
del [-x] -e <EXPRESSION>
"""
def help(self): def help(self):
return """\ return """\
Deletes the todo item(s) with the given number(s) from the list.""" Deletes the todo item(s) with the given number(s) from the list.
It is also possible to delete items as complete with an expression using
the -e flag. Use -x to also process todo items that are normally invisible
(with the 'ls' subcommand).
"""
...@@ -35,7 +35,15 @@ class DepriCommand(MultiCommand): ...@@ -35,7 +35,15 @@ class DepriCommand(MultiCommand):
self.out(self.printer.print_todo(todo)) self.out(self.printer.print_todo(todo))
def usage(self): def usage(self):
return """Synopsis: depri <NUMBER1> [<NUMBER2> ...]""" return """\
Synopsis: depri <NUMBER1> [<NUMBER2> ...]
depri [-x] -e <EXPRESSION>
"""
def help(self): def help(self):
return """Removes the priority of the given todo item(s).""" return """Removes the priority of the given todo item(s).
It is also possible to deprioritize items as complete with an expression using
the -e flag. Use -x to also process todo items that are normally invisible
(with the 'ls' subcommand).
"""
...@@ -99,11 +99,18 @@ class DoCommand(DCommand): ...@@ -99,11 +99,18 @@ class DoCommand(DCommand):
self.todolist.set_todo_completed(p_todo, self.completion_date) self.todolist.set_todo_completed(p_todo, self.completion_date)
def usage(self): def usage(self):
return """Synopsis: do [--date] [--force] [--strict] <NUMBER1> [<NUMBER2> ...]""" return """\
Synopsis: do [--date] [--force] [--strict] <NUMBER1> [<NUMBER2> ...]
do [-x] -e <EXPRESSION>
"""
def help(self): def help(self):
return """Marks the todo(s) with given number(s) as complete. return """Marks the todo(s) with given number(s) as complete.
It is also possible to mark todo items as complete with an expression using the
-e flag. Use -x to also process todo items that are normally invisible (with
the 'ls' subcommand).
In case a todo has subitems, a question is asked whether the subitems should be In case a todo has subitems, a question is asked whether the subitems should be
marked as completed as well. When --force is given, no interaction is required marked as completed as well. When --force is given, no interaction is required
and the subitems are not marked completed. and the subitems are not marked completed.
......
...@@ -75,7 +75,10 @@ class PostponeCommand(MultiCommand): ...@@ -75,7 +75,10 @@ class PostponeCommand(MultiCommand):
break break
def usage(self): def usage(self):
return "Synopsis: postpone [-s] <NUMBER> [<NUMBER2> ...] <PATTERN>" return """\
Synopsis: postpone [-s] <NUMBER> [<NUMBER2> ...] <PATTERN>"
postpone [-x] -e <EXPRESSION>
"""
def help(self): def help(self):
return """\ return """\
...@@ -84,6 +87,10 @@ Postpone the todo item(s) with the given number(s) and the given pattern. ...@@ -84,6 +87,10 @@ Postpone the todo item(s) with the given number(s) and the given pattern.
Postponing is done by adjusting the due date(s) of the todo(s), and if the -s flag is Postponing is done by adjusting the due date(s) of the todo(s), and if the -s flag is
given, the start date accordingly. given, the start date accordingly.
It is also possible to postpone items as complete with an expression using
the -e flag. Use -x to also process todo items that are normally invisible
(with the 'ls' subcommand).
The pattern is a relative date, written in the format <COUNT><PERIOD> where The pattern is a relative date, written in the format <COUNT><PERIOD> where
count is a number and <PERIOD> is either 'd', 'w', 'm' or 'y', which stands for count is a number and <PERIOD> is either 'd', 'w', 'm' or 'y', which stands for
days, weeks, months and years respectively. Example: 'postpone 1 1w' postpones days, weeks, months and years respectively. Example: 'postpone 1 1w' postpones
......
...@@ -54,9 +54,16 @@ class PriorityCommand(MultiCommand): ...@@ -54,9 +54,16 @@ class PriorityCommand(MultiCommand):
self.error("Invalid priority given.") self.error("Invalid priority given.")
def usage(self): def usage(self):
return """Synopsis: pri <NUMBER1> [<NUMBER2> ...] <PRIORITY>""" return """\
Synopsis: pri <NUMBER1> [<NUMBER2> ...] <PRIORITY>
pri [-x] -e <EXPRESSION>
"""
def help(self): def help(self):
return """\ return """\
Sets the priority of todo(s) the given number(s) to the given priority. Sets the priority of todo(s) the given number(s) to the given priority.
It is also possible to prioritize items as complete with an expression using
the -e flag. Use -x to also process todo items that are normally invisible
(with the 'ls' subcommand).
""" """
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment