Skip to content

Commit d4a1f62

Browse files
fix: --help for file parser was broken
Signed-off-by: thiswillbeyourgithub <[email protected]>
1 parent 630ffe2 commit d4a1f62

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

wdoc/__main__.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ def cli_launcher() -> None:
1616
shorthands then call wdoc"""
1717
sysline = " ".join(sys.argv)
1818

19+
# turn 'wdoc parse' into 'wdoc_parse_file'
20+
if "wdoc parse " in sysline or "wdoc parse_file" in sysline:
21+
if is_verbose:
22+
whi("Replacing 'wdoc parse' by 'wdoc_parse_file'")
23+
sys.argv[0] = str(Path(sys.argv[0]).parent / "wdoc_parse_file")
24+
del sys.argv[1]
25+
sysline = " ".join(sys.argv)
26+
cli_parse_file()
27+
raise SystemExit(0)
28+
1929
if " --version" in sysline:
2030
print(f"wdoc version: {wdoc.VERSION}")
2131
raise SystemExit(0)
@@ -35,15 +45,6 @@ def cli_launcher() -> None:
3545
whi("No args shown. Use '--help' to display the help.")
3646
raise SystemExit(0)
3747

38-
# turn 'wdoc parse' into 'wdoc_parse_file'
39-
if "wdoc parse " in sysline or "wdoc parse_file" in sysline:
40-
if is_verbose:
41-
whi("Replacing 'wdoc parse' by 'wdoc_parse_file'")
42-
sys.argv[0] = str(Path(sys.argv[0]).parent / "wdoc_parse_file")
43-
del sys.argv[1]
44-
cli_parse_file()
45-
raise SystemExit(0)
46-
4748
# while we're at it, make it so that
4849
# "wdoc summary" is parsed like "wdoc --task=summary"
4950
if " --task" not in sysline:

0 commit comments

Comments
 (0)