Article Series

This is a multiple-parts article. There are few sections here.

Where to Discuss?

Local Group

Bashful Bot

Goal: An example of Manual Page in Troff Format

Documentation would make you feel like a pro.

Previous Guidance

We’re already see a finished bash project in previous article. We should finish what we have done.

Issue

The need of Example

Manual page is easy. All you need is troff format knowledge.


Simple Manual Page

I grab my first manual page by using an example from this good site.

I name it cupubot-bash.1. The lasl character 1 means this manual in section 1 category.

.\" Manpage for cupubot-bash.
.\" Contact epsi.nurwijayadi@gmail.com to correct errors or typos.
.TH man 1 "29 Jan 2018" "v0.001" "cupubot.bash man page"
.SH NAME
cupubot-bash \- a telegram bot in bash
.SH SYNOPSIS
cupubot-bash [options]
.SH DESCRIPTION
Cupubot is a telegram bot for learning purpose, or lame people. Just another learning project.
.SH OPTIONS
The cupubot-bash takes exactly one option.
.SH SEE ALSO
jq(1), json_reformat(1)
.SH BUGS
No known bugs.
.SH AUTHOR
E. Rizqi N. Sayidina (epsi.nurwijayadi@gmail.com)

Processing

Manual page stored as .gz file. Hence we need to convert it using gzip. We can read the compressed source using zcat.

% gzip -k -f cupubot-bash.1
% zcat cupubot-bash.1.gz

BASH: Telegram Bot: gzip and zcat

We can also test the result.

% man ./cupubot-bash.1

BASH: Telegram Bot: Manual Page


Complete Text

cupubot-bash.1

.\" Manpage for cupubot-bash.
.\" Contact epsi.nurwijayadi@gmail.com to correct errors or typos.
.TH man 1 "29 Jan 2018" "v0.001" "cupubot.bash man page"
.SH NAME
cupubot-bash \- a telegram bot in bash
.SH SYNOPSIS
cupubot-bash [options]
.SH DESCRIPTION
Cupubot is a telegram bot for learning purpose, or lame people. Just another learning project.
.SH OPTIONS
The cupubot-bash takes exactly one option.
.TP
\fB\-h\fR, \fB\-\-help\fR
display help information
.TP
\fB\-v\fR, \fB\-\-version\fR, \fBversion\fR
display version information
.TP
\fB\-\-observe\fR
show JSON output of getUpdates
.TP
\fB\-\-reply\fR
reply all messages
.TP
\fB\-\-new-member\fR
greet new member
.TP
\fB\-\-logger-text\fR
log chat conversation
.TP
\fB\-\-logger-html\fR
log chat conversation
.SH SEE ALSO
jq(1), json_reformat(1)
.SH BUGS
No known bugs.
.SH AUTHOR
E. Rizqi N. Sayidina (epsi.nurwijayadi@gmail.com)

Source:

Conclusions

I’m mostly posting codes so I won’t have any problems finding it in the future.

I think that’s all. Thank you for reading.

I’l see you around. Cheerio.