]> git.armaanb.net Git - phrases.git/commitdiff
Write manpage, install it with Makefile v1.0.0
authorArmaan Bhojwani <me@armaanb.net>
Mon, 4 Jan 2021 18:52:14 +0000 (13:52 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Mon, 4 Jan 2021 18:52:14 +0000 (13:52 -0500)
Makefile
man/phrases.1 [new file with mode: 0644]
man/phrases.1.md [new file with mode: 0644]

index 8757f6e88340dcdeff0b806e69129da363a7603b..feacce8c344bde2da4178479904a60f2c3832feb 100644 (file)
--- 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 (file)
index 0000000..35c5139
--- /dev/null
@@ -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 <me@armaanb.net>.
+MIT License
+.SH AUTHORS
+Armaan Bhojwani <me@armaanb.net>.
diff --git a/man/phrases.1.md b/man/phrases.1.md
new file mode 100644 (file)
index 0000000..86f2b5c
--- /dev/null
@@ -0,0 +1,69 @@
+% phrases(1) 1.0.0
+% Armaan Bhojwani <me@armaanb.net>
+% 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 <me@armaanb.net>. MIT License