From edb5d290404b15438c4c26c015eeb017017bc230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Sat, 2 Nov 2024 11:44:50 +0100 Subject: [PATCH] Add man page. --- .gitignore | 1 + Makefile | 7 +++++- TODO.md | 2 +- menu-helper.1 | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 menu-helper.1 diff --git a/.gitignore b/.gitignore index be5e0c4..5ebbb15 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /menu-helper /compile_commands.json .cache/* +/*.1.gz diff --git a/Makefile b/Makefile index d8c41b5..3ec711e 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ DEFS= CFLAGS=$(INCFLAGS) -std=c++20 -Wall -Wextra -Wfatal-errors -Werror HDRS=src/util.hpp src/arg_parse.hpp src/db.hpp src/cmd.hpp OBJS=src/main.o src/util.o src/arg_parse.o src/db.o src/cmd.o +DOCS=menu-helper.1 VERSION=1.0 ifeq ($(PREFIX),) @@ -39,6 +40,9 @@ endif menu-helper: $(OBJS) $(CXX) -o $@ $^ $(LDFLAGS) +menu-helper.1.gz: $(DOCS) + gzip -c $< > $@ + .PHONY: clean distclean install clean: @@ -47,5 +51,6 @@ clean: distclean: clean $(RM) menu-helper -install: menu-helper +install: menu-helper menu-helper.1.gz install -m 755 menu-helper $(PREFIX)/bin/ + install -m 644 menu-helper.1.gz $(PREFIX)/share/man/man1/ diff --git a/TODO.md b/TODO.md index b2cc31e..ecf6fde 100644 --- a/TODO.md +++ b/TODO.md @@ -3,7 +3,7 @@ - [ ] v1.0 - [X] Add basic functionality. - [X] Add more safeguards to avoid bad usage. - - [ ] Create a man page. + - [X] Create a man page. - [ ] Add more documentation to `help` subcommand. - [X] Properly align output columns from `list` subcommand. - [X] Add feature for editing recipe name and description. diff --git a/menu-helper.1 b/menu-helper.1 new file mode 100644 index 0000000..98ed024 --- /dev/null +++ b/menu-helper.1 @@ -0,0 +1,65 @@ +.TH "MENU HELPER" "1" "November 2024" "menu-helper 1.0" "User Commands" +.SH "NAME" +menu-helper \- makes choosing meals easier +.SH "SYNOPSIS" +.B menu-helper +<\fICOMMAND\fR> [\fIOPTIONS\fR] + +.SH "DESCRIPTION" +A program to manage a database of recipes and help you pick out meals based on +filters of ingredients and tags. + +.SH "COMMANDS" +.TP +.B \fBadd\fR, \fBnew\fR +Add a new recipe to the database. +.TP +.B \fBdel\fR, \fBrm\fR <\fIid\fR> +Delete recipe with provided \fIid\fR. +.TP +.B \fBlist\fR, \fBls\fR [-i <\fIingredients\fR>] [-t <\fItags\fR>] +List all recipes that contain all \fIingredients\fR an \fItags\fR listed. If +none are listed, then it prints all recipes stored in the database. Both +\fIingredients\fR and \fItags\fR are comma-separated lists (e.g. +"garlic,tomato"). +.TP +.B \fBinfo\fR <\fIid\fR> +Show all stored information on recipe with provided \fIid\fR. +.TP +.B \fBedit-name\fR <\fIid\fR> +Change the name of the recipe with the provided \fIid\fR. +.TP +.B \fBedit-description\fR, \fBedit-desc\fR <\fIid\fR> +Change the description of the recipe with the provided \fIid\fR. +.TP +.B \fBadd-ingr\fR <\fIid\fR> <\fIingredients\fR> +Add the specified \fIingredients\fR to the recipe with \fIid\fR, where +\fIingredients\fR is a comma-separated list (e.g. "garlic,tomato"). +.TP +.B \fBrm-ingr\fR <\fIid\fR> <\fIingredients\fR> +Remove the specified \fIingredients\fR from the recipe with \fIid\fR, where +\fIingredients\fR is a comma-separated list (e.g. "garlic,tomato"). +.TP +.B \fBadd-tag\fR <\fIid\fR> <\fItags\fR> +Add the specified \fItags\fR to the recipe with \fIid\fR, where \fItags\fR is a +comma-separated list (e.g. "dinner,simple"). +.TP +.B \fBrm-tag\fR <\fIid\fR> <\fItags\fR> +Remove the specified \fItags\fR from the recipe with \fIid\fR, where \fItags\fR +is a comma-separated list (e.g. "dinner,simple"). +.TP +.B \fBhelp\fR, \fB-h\fR, \fB--help\fR +Show basic help information. +.TP +.B \fBversion\fR, \fB-v\fR, \fB--version\fR +Show version information. + +.SH "AUTHOR" +Written by Nicolás A. Ortega Froysa. + +.SH "COPYRIGHT" +Copyright \(co 2024 Ortega Froysa, Nicolás A. . +License: GNU General Public License version 3 or greater (see ). + +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law.