From 0a695b57f5fea49f11d9ba099bcd224cc9feac6e Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Mon, 4 Feb 2019 23:33:12 -0700 Subject: Initial commit of man page Updated the make file to produce the man page during `make` and `make install`. The make process interpolates the config using sed to find and replace jinja-style variables for the release date and the build version. Added new variable RELDATE and MANPREFIX variables to the Makefile. --- Makefile | 25 +++++++++++++++------- doc/upwgen.1 | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 8 deletions(-) create mode 100644 doc/upwgen.1 diff --git a/Makefile b/Makefile index 708457b..24870f8 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,13 @@ -CC = cc -CCOPTS = -Wall -std=gnu99 -out = upwgen -PREFIX = /usr/bin +CC = cc +CCOPTS = -Wall -std=gnu99 +out = upwgen +PREFIX = /usr/bin +MANPREFIX = /usr/share/man -VERSION = 1 -PATCHLEVEL = 1 +VERSION = 1 +PATCHLEVEL = 1 EXTRAVERSION = -rc1 +RELDATE = 2019 March 09 VERSTR = "$(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL))$(EXTRAVERSION)" @@ -13,7 +15,14 @@ all: @if [ ! -d obj ]; then mkdir obj; fi $(CC) $(CCOPTS) -c src/i18n_cat.c -o obj/i18n_cat.o $(CC) $(CCOPTS) -DVERSTR=$(VERSTR) src/main.c obj/*.o -o $(out) + # Interpolate the man page and compress + sed \ + -e "s/{{ VERSTR }}/$(VERSTR)/" \ + -e "s/{{ RELDATE }}/$(RELDATE)/" \ + doc/upwgen.1 | gzip -c > upwgen.1.gz install: - mkdir -p $(DESTDIR)/$(PREFIX) - cp $(out) $(DESTDIR)/$(PREFIX)/$(out) + # Install the binary + install -D -m 755 $(out) "$(DESTDIR)/$(PREFIX)/$(out)" + # Install the man page + install -D -m 644 upwgen.1.gz "$(DESTDIR)/$(MANPREFIX)/man1/upwgen.1.gz" diff --git a/doc/upwgen.1 b/doc/upwgen.1 new file mode 100644 index 0000000..e919b22 --- /dev/null +++ b/doc/upwgen.1 @@ -0,0 +1,69 @@ +.TH UPWGEN 1 "{{ RELDATE }}" "pwgen version {{ VERSTR }}" +.SH NAME +upwgen \- generate international (utf-8) passwords +.SH SYNOPSIS +.B upwgen +[ +.I OPTIONS +] +[ +.I pw_length +] +.SH DESCRIPTION +The +.B upwgen +program generates passwords which include international characters, +significantly increasing password complexity. These passwords are not only +designed to be difficult to memorize, but are also nearly impossible to type as +they will usually span multiple character sets, requiring multiple keyboard +locales. By design, the passwords generated by upwgen are intended to be copied +and pasted. + +The default mode of operation if no arguments are specified is to print a +password of 32 characters long, selected from the printable English ascii +character pool (94 characters total). +.B +.SH OPTIONS +.TP +.B \-c, --capitalize +Include at least one capital letter in the password. +.TP +.B \-l, --lower +Include at least one lower case letter in the password. +.TP +.B \-n, --numerals +Include at least one number in the password. +.TP +.B \-y, --symbols +Include at least one special character in the password. +.TP +.B \-1 +Include chars from the most used scripts in the world +.TP +.B \-2 +Include chars from the second most used scripts in the world +.TP +.B \-3 +Include chars from the third most used scripts in the world +.TP +.B \-4 +Include chars from the forth most used scripts in the world +.TP +.B \-i, --i18n +Include all supported international characters (same as -1 -2 -3 -4) +.TP +.B \-h, --help +Print the help text +.TP +.B \-V, --version +Print the version +.TP +.B \-d, --debug +Enable debug mode (prints entire selected character pool) +.SH AUTHOR +.B Upwgen +was written by Aaron Ball . +It is modelled after pwgen, a program written by Theodore Ts'o. +.SH SEE ALSO +.BR passwd (1) +.BR pwgen (1) -- cgit v1.2.3