Skip to content

Man Page on Windows #82

Description

@thecliguy

I'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()

man-page-on-windows

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions