Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to generate manpage and documentation for BSD systems #326

Merged
merged 4 commits into from
Oct 20, 2020

Conversation

sergeyklay
Copy link
Collaborator

@sergeyklay sergeyklay commented Oct 19, 2020

Add the ability to generate manpage and documentation for BSD systems

  • Stripping headers may not work as expected, as man output differs on different systems. This should work now.
  • Simplified output parsing procedure by replacing the regular expression by TERM=dumb.
  • Stripping escape sequences.
  • Added documentation about the intentions of this script.

Check for man and sed on Windows when RE2C_REBUILD_DOCS is ON

Windows does not have a native man and sed commands. Therefore, we are looking for the Cygwin versions of man and sed. This doesn't add full Windows support. However, in case of the absence of the required programs, this shows error messages before the build stage.

Rephrase error messages for RE2C_REBUILD_DOCS=ON

This aims to provide a bit more clear error messages on regenerate manpage stage as well as documentation.

Remove rst2man output redirection as it doesn't work on Windows

There is no need for redirect output with > (which doesn't work on Windows) as this is how rst2man works:

  rst2man [options] [<source> [<destination>]]

For the discussion see: #325

Copy link
Owner

@skvadrik skvadrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great patch, made me learn about col and grep -A! They both seem to be non-POSIX (grep has no -A: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html, and col seems to have been excluded: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap04.html). But I tested this both on Linux and FreeBSD and it works, so let's use them.

build/gen_help.sh Outdated Show resolved Hide resolved
build/gen_help.sh Outdated Show resolved Hide resolved
build/gen_help.sh Show resolved Hide resolved
Copy link
Owner

@skvadrik skvadrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit title is missing "for" (Add the ability for generating... or Add the ability to generate...).

@sergeyklay sergeyklay changed the title Add ability generating manpage and documentation for BSD systems Add the ability to generate generate manpage and documentation for BSD systems Oct 19, 2020
@sergeyklay sergeyklay changed the title Add the ability to generate generate manpage and documentation for BSD systems Add the ability to generate manpage and documentation for BSD systems Oct 19, 2020
- Stripping headers may not work as expected, as man output differs
  on different systems. This should work now.
- Simplified output parsing procedure by replacing the regular
  expression by TERM=dumb.
- Stripping escape sequences.
- Added documentation about the intentions of this script.

For more see: skvadrik#325
Windows does not have a native 'man' and 'sed' commands.
Therefore, we are looking for the Cygwin versions of 'man' and 'sed'.

For more see: skvadrik#325
This aims to provide a bit more clear error messages on regenerate
manpage stage as well as documentation.
There is no need for redirect output with > (which doesn't work on
Windows) as this is how rst2man works:

  rst2man [options] [<source> [<destination>]]

For more see: skvadrik#325
build/gen_help.sh Show resolved Hide resolved
@sergeyklay sergeyklay merged commit 8bfac01 into skvadrik:master Oct 20, 2020
@sergeyklay sergeyklay deleted the fix/genhelp branch October 20, 2020 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants