Man Page on Windows
See original GitHub issueI’m contemplating whether it would be possible make the man page available in Windows.
This is not a complete solution, these are just my initial thoughts exploring what would be required and how we might go about doing it… Any thoughts, feedback or suggestions would be welcome…
Converting the man page to a readable format for the Windows console
Since Windows doesn’t have a manual reader, the man page would need to be converted to a format that can be rendered in the Windows console. This would have to be performed as part of the build process when there’s a new release.
One option would be to simply convert it to plain text output. This conversion can be achieved as follows:
MANWIDTH=80 man ./ssh-audit.1 > ssh_audit_windows_man.txt
In Windows 10, the console is capable of interpreting ANSI escape sequences (also known as VT escape sequences). So another option would be to convert the man page to ANSI escape sequence formatted output, this would preserve any typographical emphasis that’s present in the original man page, such as bold and underlined text. This conversion can be achieved as follows:
# * man outputs a backspace-overwrite sequence rather than an ANSI escape
# sequence.
# * 'MAN_KEEP_FORMATTING' preserves the backspace-overwrite sequence when
# redirected to a file or a pipe.
# * The 'ul' command converts the backspace-overwrite sequence to an ANSI escape
# sequence.
MANWIDTH=80 MAN_KEEP_FORMATTING=1 man ./ssh-audit.1 | ul > ssh_audit_windows_man.txt
Example of an ANSI escape sequence formatted man page on Windows 10
import os
os.system("color")
f = open('c:\\bitbucket\\ssh_audit_windows_man.txt', encoding="utf-8")
file_contents = f.read()
print (file_contents)
f.close()
Displaying the man page
Displaying the man page could perhaps be invoked using a command line parameter such as:
ssh-audit.exe --manual
Packaging the converted man page
Currently the Windows package is a standalone executable with no external dependencies. Ideally any solution that’s adopted would preserve this.
Does anyone know of a way that the man page (in its converted format) could be embedded into the ssh-audit executable without having to ship an external text file?
Issue Analytics
- State:
- Created 3 years ago
- Comments:35 (34 by maintainers)
Top GitHub Comments
Merged. Thanks for helping me with this!
I’d like to get a release out the door soon. I’m just waiting on a block of hours to free up so I can focus on packaging everything up correctly. Hopefully that will be within the next few days!
Thanks again!
I’ll switch to Python 3.9 for Windows builds, then.
To update PACKAGING? That wouldn’t be necessary. I’ll update it myself with tweaks after each time I package a new release.