Commit 12045748 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Fix synopsis and help for expression commands.

parent b1f6a320
......@@ -38,8 +38,16 @@ class DeleteCommand(DCommand):
self.execute_specific_core(p_todo)
def usage(self):
return """Synopsis: del [-f] <NUMBER1> [<NUMBER2> ...]"""
return """\
Synopsis: del [-f] <NUMBER1> [<NUMBER2> ...]
del [-x] -e <EXPRESSION>
"""
def help(self):
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):
self.out(self.printer.print_todo(todo))
def usage(self):
return """Synopsis: depri <NUMBER1> [<NUMBER2> ...]"""
return """\
Synopsis: depri <NUMBER1> [<NUMBER2> ...]
depri [-x] -e <EXPRESSION>
"""
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).
"""
......@@ -100,11 +100,18 @@ class DoCommand(DCommand):
self.todolist.set_todo_completed(p_todo, self.completion_date)
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):
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
marked as completed as well. When --force is given, no interaction is required
and the subitems are not marked completed.
......
......@@ -75,7 +75,10 @@ class PostponeCommand(MultiCommand):
break
def usage(self):
return "Synopsis: postpone [-s] <NUMBER> [<NUMBER2> ...] <PATTERN>"
return """\
Synopsis: postpone [-s] <NUMBER> [<NUMBER2> ...] <PATTERN>"
postpone [-x] -e <EXPRESSION>
"""
def help(self):
return """\
......@@ -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
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
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
......
......@@ -54,9 +54,16 @@ class PriorityCommand(MultiCommand):
self.error("Invalid priority given.")
def usage(self):
return """Synopsis: pri <NUMBER1> [<NUMBER2> ...] <PRIORITY>"""
return """\
Synopsis: pri <NUMBER1> [<NUMBER2> ...] <PRIORITY>
pri [-x] -e <EXPRESSION>
"""
def help(self):
return """\
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