From c622dc5d1608256d3da9cf9763dd86c9d8ff9a81 Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Mon, 4 Jan 2021 13:52:14 -0500 Subject: [PATCH] Write manpage, install it with Makefile --- Makefile | 3 ++ man/phrases.1 | 77 ++++++++++++++++++++++++++++++++++++++++++++++++ man/phrases.1.md | 69 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 man/phrases.1 create mode 100644 man/phrases.1.md diff --git a/Makefile b/Makefile index 8757f6e..feacce8 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,16 @@ install: mkdir -p /usr/local/bin + mkdir -p /usr/local/man/man1 mkdir -p /usr/local/share/phrases/ cp phrases.py /usr/local/bin/phrases cp phrases.db /usr/local/share/phrases/ + cp man/phrases.1 /usr/local/man/man1/ uninstall: rm /usr/local/bin/phrases rm -r /usr/local/share/phrases/ + rm /usr/local/man/man1/phrases.1 reinstall: make uninstall diff --git a/man/phrases.1 b/man/phrases.1 new file mode 100644 index 0000000..35c5139 --- /dev/null +++ b/man/phrases.1 @@ -0,0 +1,77 @@ +.\" Automatically generated by Pandoc 2.11.3 +.\" +.TH "phrases" "1" "January 2021" "1.0.0" "" +.hy +.SH NAME +.PP +phrases - Latin famous phrases in the terminal +.SH SYNOPSIS +.PP +phrases [options] +.SH DESCRIPTION +.PP +\f[B]phrases\f[R] is a Python script that reads Latin famous phrases +from a SQLite database and returns them randomly according to a set of +user-defined parameters given through the CLI options. +.SH OPTIONS +.TP +\f[B]-h\f[R], \f[B]\[en]help\f[R] +Show a help message and exit +.TP +\f[B]-i\f[R], \f[B]\[en]id\f[R] +Print the id of the phrase. +.TP +\f[B]-l\f[R], \f[B]\[en]latin\f[R] +Print the Latin phrase (default) +.TP +\f[B]-e\f[R], \f[B]\[en]english\f[R] +Print the English translation. +.TP +\f[B]-n\f[R], \f[B]\[en]notes\f[R] +Print any notes on phrase. +.TP +\f[B]-v\f[R], \f[B]\[en]version\f[R] +Print version +.TP +\f[B]-m\f[R] [length], \f[B]\[en]min\f[R] [length] +Set the minimum length of the Latin phrase. +.TP +\f[B]-M\f[R] [length], \f[B]\[en]max\f[R] [length] +Set the maximum length of Latin phrase. +.TP +\f[B]-p\f[R], \f[B]\[en]num\f[R] +Print number of possible phrases. +.TP +\f[B]-f\f[R] [path], \f[B]\[en]file\f[R] [path] +Set the path of the phrase database. +.SH EXAMPLES +.TP +\f[B]phrases\f[R] +Display a random Latin phrase +.TP +\f[B]phrases -len\f[R] +Display a random Latin phrase, its English translation, and any notes on +it +.TP +\f[B]phrases -p -m 10 -M 15\f[R] +Display the number of phrases in the database with a length between 10 +and 15 inclusive. +.SH EXIT VALUES +.TP +\f[B]0\f[R] +Success +.TP +\f[B]1\f[R] +Cannot find phrase database +.TP +\f[B]2\f[R] +Invalid option +.SH BUGS, PATCHES +.PP +https://lists.sr.ht/\[ti]armaan/public-inbox +.SH COPYRIGHT +.PP +Copyright 2021 Armaan Bhojwani . +MIT License +.SH AUTHORS +Armaan Bhojwani . diff --git a/man/phrases.1.md b/man/phrases.1.md new file mode 100644 index 0000000..86f2b5c --- /dev/null +++ b/man/phrases.1.md @@ -0,0 +1,69 @@ +% phrases(1) 1.0.0 +% Armaan Bhojwani +% January 2021 + +# NAME +phrases - Latin famous phrases in the terminal + +# SYNOPSIS +phrases [[options]] + +# DESCRIPTION +**phrases** is a Python script that reads Latin famous phrases from a SQLite database and returns them randomly according to a set of user-defined parameters given through the CLI options. + +# OPTIONS +**-h**, **--help** +: Show a help message and exit + +**-i**, **--id** +: Print the id of the phrase. + +**-l**, **--latin** +: Print the Latin phrase (default) + +**-e**, **--english** +: Print the English translation. + +**-n**, **--notes** +: Print any notes on phrase. + +**-v**, **--version** +: Print version + +**-m** [length], **--min** [length] +: Set the minimum length of the Latin phrase. + +**-M** [length], **--max** [length] +: Set the maximum length of Latin phrase. + +**-p**, **--num** +: Print number of possible phrases. + +**-f** [path], **--file** [path] +: Set the path of the phrase database. + +# EXAMPLES +**phrases** +: Display a random Latin phrase + +**phrases -len** +: Display a random Latin phrase, its English translation, and any notes on it + +**phrases -p -m 10 -M 15** +: Display the number of phrases in the database with a length between 10 and 15 inclusive. + +# EXIT VALUES +**0** +: Success + +**1** +: Cannot find phrase database + +**2** +: Invalid option + +# BUGS, PATCHES +https://lists.sr.ht/~armaan/public-inbox + +# COPYRIGHT +Copyright 2021 Armaan Bhojwani . MIT License -- 2.39.2