~valhalla/lesana-devel

Add description to subparsers v1 PROPOSED

fabrixxm: 1
 Add description to subparsers

 2 files changed, 1 insertions(+), 3 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~valhalla/lesana-devel/patches/21873/mbox | git am -3
Learn more about email & git

[PATCH] Add description to subparsers Export this patch

---
 lesana/command.py | 2 +-
 scripts/lesana    | 2 --
 2 files changed, 1 insertion(+), 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 @@ def main(self):
        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


-- 
2.31.1