From 7b4d871413df856ecc3407cb0a0dd7324f3cd406 Mon Sep 17 00:00:00 2001 From: Satish Mane Date: Aug 18 2025 10:40:59 +0000 Subject: man_gen: generate correct usage for `srpm` in manpages The `srpm` command’s manpage showed the short description ("Create a source rpm") where the usage line should be. During manpage generation, detect this placeholder usage and reset it to None so argparse renders the full autogenerated usage (with options). This updates both the "COMMAND OVERVIEW" and "COMMAND REFERENCE" sections. No runtime behavior change; only manpage generation is affected. Signed-off-by: Satish Mane --- diff --git a/pyrpkg/man_gen.py b/pyrpkg/man_gen.py index b739e42..b257bd4 100644 --- a/pyrpkg/man_gen.py +++ b/pyrpkg/man_gen.py @@ -144,6 +144,11 @@ def generate(parser, subparsers, identity, sourceurl): cmdparser = choices[command] if not cmdparser.add_help: continue + + # Fix srpm command usage text - reset to None so argparse generates proper usage + if command == 'srpm' and hasattr(cmdparser, 'usage') and cmdparser.usage == 'Create a source rpm': + cmdparser.usage = None + usage = cmdparser.format_usage() usage = strip_usage(usage) usage = ''.join(usage.split('\n')) @@ -158,6 +163,10 @@ def generate(parser, subparsers, identity, sourceurl): cmdparser = choices[command] if not cmdparser.add_help: continue + + # Fix srpm command usage text - reset to None so argparse generates proper usage + if command == 'srpm' and hasattr(cmdparser, 'usage') and cmdparser.usage == 'Create a source rpm': + cmdparser.usage = None man_file.write('.SS "%s"\n' % cmdparser.prog)