Skip to content

Commit

Permalink
Fixed man page parsing error. (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtesta committed Oct 16, 2024
1 parent d7fff59 commit 3fa62c3
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions add_builtin_man_page.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,9 @@ echo "Processing man page at ${MAN_PAGE} and placing output into ${GLOBALS_PY}..
# * 'MAN_KEEP_FORMATTING' preserves the backspace-overwrite sequence when
# redirected to a file or a pipe.
# * sed converts unicode hyphens into an ASCI equivalent.
# * The 'ul' command converts the backspace-overwrite sequence to an ANSI
# escape sequence. Not required under Cygwin because man outputs ANSI escape
# codes automatically.

echo BUILTIN_MAN_PAGE = '"""' >> "${GLOBALS_PY}"

if [[ "${PLATFORM}" == CYGWIN* ]]; then
MANWIDTH=80 MAN_KEEP_FORMATTING=1 man "${MAN_PAGE}" | sed $'s/\u2010/-/g' >> "${GLOBALS_PY}"
else
MANWIDTH=80 MAN_KEEP_FORMATTING=1 man "${MAN_PAGE}" | ul | sed $'s/\u2010/-/g' >> "${GLOBALS_PY}"
fi

MANWIDTH=80 MAN_KEEP_FORMATTING=1 man "${MAN_PAGE}" | sed $'s/\u2010/-/g' >> "${GLOBALS_PY}"
echo '"""' >> "${GLOBALS_PY}"

echo "Done."
Expand Down

0 comments on commit 3fa62c3

Please sign in to comment.