From 6a89e5ae98e478acd387ba32d825d3fa1392d8cf Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Thu, 29 Dec 2016 16:49:52 +0100 Subject: Document subcommands in help output --- alot/__main__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'alot/__main__.py') diff --git a/alot/__main__.py b/alot/__main__.py index 4a52f50b..b55c9999 100644 --- a/alot/__main__.py +++ b/alot/__main__.py @@ -37,7 +37,10 @@ def main(): parser.add_argument('-l', '--logfile', default='/dev/null', type=lambda x: argparse.FileType('w')(x).name, help='logfile [default: %(default)s]') - parser.add_argument('command', nargs=argparse.REMAINDER) + # We will handle the subcommands in a seperate run of argparse as argparse + # does not support optional subcommands until now. + parser.add_argument('command', nargs=argparse.REMAINDER, + help="possible subcommands are 'search' and 'compose'") options = parser.parse_args() if options.command: # We have a command after the initial options so we also parse that. @@ -112,5 +115,6 @@ def main(): if exit_hook is not None: exit_hook() + if __name__ == "__main__": main() -- cgit v1.2.3