Commit fc00dce0 authored by Jacek Sowiński's avatar Jacek Sowiński

Fix help in prompt-mode

This is done with catching TypeError and calling
topydo.cli.CLIApplicationsBase.usage.
parent 83b84fa5
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
import sys import sys
from topydo.cli.CLIApplicationBase import CLIApplicationBase, error from topydo.cli.CLIApplicationBase import CLIApplicationBase, error, usage
from topydo.cli.TopydoCompleter import TopydoCompleter from topydo.cli.TopydoCompleter import TopydoCompleter
from prompt_toolkit.shortcuts import get_input from prompt_toolkit.shortcuts import get_input
from prompt_toolkit.history import History from prompt_toolkit.history import History
...@@ -66,6 +66,7 @@ class PromptApplication(CLIApplicationBase): ...@@ -66,6 +66,7 @@ class PromptApplication(CLIApplicationBase):
(subcommand, args) = get_subcommand(user_input) (subcommand, args) = get_subcommand(user_input)
try:
if self._execute(subcommand, args) != False: if self._execute(subcommand, args) != False:
if self.todolist.is_dirty(): if self.todolist.is_dirty():
self._archive() self._archive()
...@@ -74,6 +75,8 @@ class PromptApplication(CLIApplicationBase): ...@@ -74,6 +75,8 @@ class PromptApplication(CLIApplicationBase):
self._execute(SortCommand, []) self._execute(SortCommand, [])
self.todofile.write(str(self.todolist)) self.todofile.write(str(self.todolist))
except TypeError:
usage()
def main(): def main():
""" Main entry point of the CLI. """ """ Main entry point of the CLI. """
......
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