Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions dargs/dargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,16 @@ def gen_doc_flag(self, path: list[str] | None = None, **kwargs) -> str:
choicedoc = indent("| possible choices: " + ", ".join(l_choice), INDENT)
realdoc = indent(self.doc + "\n", INDENT) if self.doc else None
anchor = make_rst_refid(arg_path) if kwargs.get("make_anchor") else None
abstractdoc = indent(
"\n".join(
[
f"* {ll}: {cc.doc}"
for ll, cc in zip(l_choice, self.choice_dict.values())
if cc.doc
]
),
INDENT,
)
allparts = [
anchor,
headdoc,
Expand All @@ -960,6 +970,9 @@ def gen_doc_flag(self, path: list[str] | None = None, **kwargs) -> str:
choicedoc,
"",
realdoc,
"",
abstractdoc,
"",
targetdoc,
]
return "\n".join([x for x in allparts if x is not None])
Expand Down