diff --git a/CMakeLists.txt b/CMakeLists.txt index e315775..dde9e9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,3 +25,5 @@ project( add_subdirectory(src) +add_subdirectory(doc) + diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 0000000..d7103b9 --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,3 @@ +if(PIHELPER_EXECUTABLE) + install(FILES pihelper.1 DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/man/man1") +endif() diff --git a/doc/pihelper.1 b/doc/pihelper.1 new file mode 100644 index 0000000..8b2c10c --- /dev/null +++ b/doc/pihelper.1 @@ -0,0 +1,84 @@ +.TH PIHELPER 1 2020-01-10 "PiHelper 0.1.0" +.SH NAME +pihelper \- enable, disable, or view the status of a Pi-hole +.SH SYNOPSIS +.B pihelper [ +.I options +] +.SH DESCRIPTION +Pihelper is a command-line utility used to enable, disable, or view the status of a given Pi-hole. It supports using alternative configuration files in order to manage multiple Pi-holes. +.SH OPTIONS +.IP "-c, --configure" +.RS +Create (or replace) the pihelper configuration. +.RE +.IP "-d, --disable " +.RS +Disable the Pi-hole for a given number of seconds. +.br +.br +If no argument is passed, disable the Pi-hole permanently. +.RE +.IP "-e, --enable" +.RS +Enable the Pi-hole. +.RE +.IP "-f, --file " +.RS +Use the given configuration file. +.RE +.IP "-h, --help" +.RS +Display the help message. +.RE +.IP "-q, --quiet" +.RS +Suppress all output. +.RE +.IP "-v, --verbose" +.RS +Print additional output. +.RE +.SH EXIT STATUS +The exit status for +.B pihelper +is dependent upon the status of the Pi-hole. +.IP \-1 +.B pihelper +was unable to connect to the Pi-hole. +.IP 0 +The Pi-hole is enabled +.IP 1 +The Pi-hole is disabled. +.SH FILES +.IP ~/.config/pihelper.conf +The default configuration file. +.SH EXAMPLES +Print the status of the Pi-hole: +.PP +.RS +pihelper +.RE +.PP +Enable the Pi-hole: +.PP +.RS +pihelper -e +.RE +.PP +Disable the Pi-hole permanently: +.PP +.RS +pihelper -d +.RE +.PP +Disable the Pi-hole for 5 minutes: +.PP +.RS +pihelper -d300 +.SH AUTHOR +Originally written by William Brawner +.SH COPYRIGHT +Copyright (c) 2019-2020 William Brawner +.PP +PiHelper is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.