aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2021-04-07 15:55:32 +0200
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2021-04-10 10:18:54 +0200
commit3ea722f84b0cc91d4a076553afbe365a13912435 (patch)
treec16e64fe8d017794fd55d3569404c42ed5a49b71
parentfea348c7b4cf3b39510b6707320c2afce2ca7835 (diff)
Add description to subparsers
-rw-r--r--lesana/command.py2
-rwxr-xr-xscripts/lesana2
2 files changed, 1 insertions, 3 deletions
diff --git a/lesana/command.py b/lesana/command.py
index 62c8020..1dc9add 100644
--- a/lesana/command.py
+++ b/lesana/command.py
@@ -29,7 +29,7 @@ class MainCommand:
self.subparsers = self.parser.add_subparsers()
for name, sub in self.commands:
sub_help = _get_first_docstring_line(sub)
- s_parser = self.subparsers.add_parser(name, help=sub_help)
+ s_parser = self.subparsers.add_parser(name, help=sub_help, description=sub_help)
for arg in sub.arguments:
s_parser.add_argument(*arg[0], **arg[1])
s_parser.set_defaults(func=sub._main)
diff --git a/scripts/lesana b/scripts/lesana
index a9778ab..51d5f7a 100755
--- a/scripts/lesana
+++ b/scripts/lesana
@@ -3,8 +3,6 @@
Lesana Command Line interface
"""
-import argparse
-
import lesana.command