@@ -2467,9 +2467,9 @@ def _parse_args(self, argv: list[str] | None = None) -> argparse.Namespace:
24672467 parser = argparse .ArgumentParser (formatter_class = argparse .RawTextHelpFormatter )
24682468 self ._init_global_parser (parser )
24692469 subparsers = parser .add_subparsers (title = "command" , dest = "command" )
2470- subparser = subparsers .add_parser ("help" , help = "show help" )
2470+ _ = subparsers .add_parser ("help" , help = "show help" )
24712471 for cmd_name , cmd in self .commands .items ():
2472- subparser = subparsers .add_parser (cmd_name , help = cmd .desc ) # pylint: disable=protected-access
2472+ subparser = subparsers .add_parser (cmd_name , help = cmd .help , description = cmd . desc ) # pylint: disable=protected-access
24732473 for cmd_parser in cmd ._parse_args : # pylint: disable=protected-access
24742474 cmd_parser (subparser )
24752475 self .global_args = parser .parse_args (argv )
@@ -2604,7 +2604,12 @@ def wrapped(*args: Any, **kw: Any) -> Any:
26042604 raise PodmanComposeError ("Command must be async" )
26052605 wrapped ._compose = self .compose # type: ignore[attr-defined]
26062606 # Trim extra indentation at start of multiline docstrings.
2607- wrapped .desc = self .cmd_desc or re .sub (r"^\s+" , "" , func .__doc__ or "" ) # type: ignore[attr-defined]
2607+ help_desc = self .cmd_desc or re .sub (r"^\s+" , "" , func .__doc__ or "" ) # type: ignore[attr-defined]
2608+ if "\n " in help_desc :
2609+ wrapped .help , wrapped .desc = help_desc .split ("\n " , 1 ) # type: ignore[attr-defined]
2610+ else :
2611+ wrapped .help = help_desc # type: ignore[attr-defined]
2612+ wrapped .desc = None # type: ignore[attr-defined]
26082613 wrapped ._parse_args = [] # type: ignore[attr-defined]
26092614 self .compose .commands [self .cmd_name ] = wrapped
26102615 return wrapped
0 commit comments