From d5ae797e8ecf83aebba658972a51fd6b1f093188 Mon Sep 17 00:00:00 2001 From: Linus Date: Mon, 26 Sep 2022 17:56:47 +0200 Subject: [PATCH 1/2] Add documentation comment to help text of subparser --- clipyarser/clipyarser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/clipyarser/clipyarser.py b/clipyarser/clipyarser.py index bc98ba5..7e6a9df 100644 --- a/clipyarser/clipyarser.py +++ b/clipyarser/clipyarser.py @@ -69,6 +69,7 @@ def create_subparsers(self, parser: ArgumentParser): for function_name, function in self._subcommand_functions.items(): # Create subparser for this function subparser = subparsers.add_parser(function_name) + subparser.description = function.__doc__ Clipyarser.add_args(parser=subparser, function=function) @staticmethod From 3354e612c95829eb8a4535c28ad3eb6f70c50cb3 Mon Sep 17 00:00:00 2001 From: Linus Date: Mon, 26 Sep 2022 17:57:10 +0200 Subject: [PATCH 2/2] Add documentation comment to help text of main function --- clipyarser/clipyarser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/clipyarser/clipyarser.py b/clipyarser/clipyarser.py index 7e6a9df..70023ee 100644 --- a/clipyarser/clipyarser.py +++ b/clipyarser/clipyarser.py @@ -60,6 +60,7 @@ def create_main_parser(self): """Creates the main ArgumentParser and includes the arguments of self._main_function.""" parser = ArgumentParser(prog=self.name, description=self.description) if self._main_function: + parser.description = self._main_function.__doc__ Clipyarser.add_args(parser=parser, function=self._main_function) return parser