From e7212bd1edc60395e2a4ee6a5ddfa578af5d1355 Mon Sep 17 00:00:00 2001 From: Josh Beale Date: Wed, 10 Jun 2026 20:49:50 -0400 Subject: [PATCH 1/9] Updated help and version text to be compatible with help2man --- inline-checksum | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/inline-checksum b/inline-checksum index bde8de7..beb2f25 100755 --- a/inline-checksum +++ b/inline-checksum @@ -64,18 +64,19 @@ usage() { Usage: ${_program_name} [-h|V] | [-x] [-a[=| ]] [TARGET_FILE] Options: - -h, --help Show this help message and exit. - -V, --version Show version information and exit. - -a, --algorithm The algorithm used to compute the checksum. Accepts one of 'sha256', 'sha512', or 'md5'. Defaults to 'sha256' if unspecified. - -x, --output-filename Output filename when piping, instead of file contents. The caller is responsible for cleaning up any resulting temporary files. - -- Stop processing command line arguments. + -h, --help Show this help message and exit. + -V, --version Show version information and exit. + -a, --algorithm The algorithm used to compute the checksum. Accepts one of 'sha256', 'sha512', or 'md5'. Defaults to 'sha256' if unspecified. + -x, --output-filename Output filename when piping, instead of file contents. The caller is responsible for cleaning up any resulting temporary files. + -- Stop processing command line arguments. Positional Arguments: - The checksum against which to compare. - [TARGET_FILE] The file to compute a checksum for. If absent or '-', reads input from stdin. + The checksum against which to compare. + [TARGET_FILE] The file to compute a checksum for. If absent or '-', reads input from stdin. Examples: - curl -fsSL | inline-checksum [-x] [--algorithm[=| ]] | sh - + curl -fsSL | inline-checksum [-x] [--algorithm[=| ]] [| sh -] + inline-checksum [-x] [--algorithm[=| ]] [| sh -] EOF } @@ -83,7 +84,7 @@ usage() { version() { cat <<-EOF Inline-Checksum ${_version} - Copyright © 2026 Josh Beale . + Copyright (C) 2026 Josh Beale . Licence MIT: This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. From d6aa9a11510cf99644f0fcfa105edb91be914db6 Mon Sep 17 00:00:00 2001 From: Josh Beale Date: Wed, 10 Jun 2026 20:50:09 -0400 Subject: [PATCH 2/9] Updated usage examples in README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e687b4b..48c759b 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@ After running the test suite, you can clean up the generated log files with `mak Assuming a site provides it, a checksum can be used to verify a downloaded script before running it as follows: ```sh -curl -fsSL | inline-checksum [--algorithm[=| ]] | sh - +curl -fsSL | inline-checksum [--algorithm[=| ]] [| sh -] ``` Alternatively, a local file can have its checksum validated as follows: ```sh -inline-checksum [--algorithm[=| ]] +inline-checksum [--algorithm[=| ]] [| sh -] ``` # Uninstallation From e2a9b295bf321c8922ace4c8e7d65ef638f40ec4 Mon Sep 17 00:00:00 2001 From: Josh Beale Date: Wed, 10 Jun 2026 20:51:07 -0400 Subject: [PATCH 3/9] Added man page for inline-checksum --- inline-checksum.1 | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 inline-checksum.1 diff --git a/inline-checksum.1 b/inline-checksum.1 new file mode 100644 index 0000000..a332ee2 --- /dev/null +++ b/inline-checksum.1 @@ -0,0 +1,55 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. +.TH INLINE-CHECKSUM "1" "June 2026" "Inline-Checksum 1.1.2" "User Commands" +.SH NAME +Inline-Checksum \- manual page for Inline-Checksum 1.1.2 +.SH SYNOPSIS +.B inline-checksum +[\fI\,-h|V\/\fR] \fI\,| \/\fR[\fI\,-x\/\fR] [\fI\,-a\/\fR[\fI\,=| \/\fR]\fI\,\/\fR] \fI\, \/\fR[\fI\,TARGET_FILE\/\fR] +.SH DESCRIPTION +Calculates a checksum for a target and compares it to a provided checksum. +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Show this help message and exit. +.TP +\fB\-V\fR, \fB\-\-version\fR +Show version information and exit. +.TP +\fB\-a\fR, \fB\-\-algorithm\fR +The algorithm used to compute the checksum. Accepts one of 'sha256', 'sha512', or 'md5'. Defaults to 'sha256' if unspecified. +.TP +\fB\-x\fR, \fB\-\-output\-filename\fR +Output filename when piping, instead of file contents. The caller is responsible for cleaning up any resulting temporary files. +.TP +\fB\-\-\fR +Stop processing command line arguments. +.SS "Positional Arguments:" +.TP + +The checksum against which to compare. +.TP +[TARGET_FILE] +The file to compute a checksum for. If absent or '\-', reads input from stdin. +.SH EXAMPLES +.IP +curl \-fsSL | inline\-checksum [\-x] [\-\-algorithm[=| ]] [| sh \-] +.IP +inline\-checksum [\-x] [\-\-algorithm[=| ]] [| sh \-] +.SH COPYRIGHT +Copyright \(co 2026 Josh Beale . +Licence MIT: +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +The full documentation for +.B Inline-Checksum +is maintained as a Texinfo manual. If the +.B info +and +.B Inline-Checksum +programs are properly installed at your site, the command +.IP +.B info Inline-Checksum +.PP +should give you access to the complete manual. From 5598ccd0c5a2352702197416c72fcc47aeb0861f Mon Sep 17 00:00:00 2001 From: Josh Beale Date: Wed, 10 Jun 2026 21:05:51 -0400 Subject: [PATCH 4/9] Moved documentation files to a subfolder --- inline-checksum-completion => docs/inline-checksum-completion | 0 inline-checksum.1 => docs/inline-checksum.1 | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename inline-checksum-completion => docs/inline-checksum-completion (100%) rename inline-checksum.1 => docs/inline-checksum.1 (100%) diff --git a/inline-checksum-completion b/docs/inline-checksum-completion similarity index 100% rename from inline-checksum-completion rename to docs/inline-checksum-completion diff --git a/inline-checksum.1 b/docs/inline-checksum.1 similarity index 100% rename from inline-checksum.1 rename to docs/inline-checksum.1 From bcd50e343183dc36d17643c95c6b36587bf83168 Mon Sep 17 00:00:00 2001 From: Josh Beale Date: Wed, 10 Jun 2026 21:22:08 -0400 Subject: [PATCH 5/9] Updated makefile to include default target, automatic manpage generation, and separate install targets for documentation / completion and the executable --- Makefile | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 7da89e6..a6834e4 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,21 @@ SHELL := /usr/bin/env sh TESTS := $(wildcard tests/*.sh) +INSTALL ?= install PREFIX ?= /usr/local BASH_COMP_DIR := $(shell pkg-config --variable=completionsdir bash-completion 2>/dev/null) ifeq ($(BASH_COMP_DIR),) BASH_COMP_DIR = /usr/share/bash-completion/completions endif ZSH_COMP_DIR ?= $(PREFIX)/share/zsh/site-functions +MANDIR ?= $(PREFIX)/share/man +MAN1DIR = $(MANDIR)/man1 -.PHONY: clean install test uninstall +.PHONY: all clean info install install-inline-checksum install-inline-checksum-docs test uninstall + +default: all + +all: info clean: ifneq ($(wildcard tests/*.log),) @@ -32,14 +39,29 @@ test: done; \ [ "$$FAILURE" -eq 0 ] || exit 1 -install: +info: + @help2man inline-checksum -o docs/inline-checksum.1 + +install: install-inline-checksum install-inline-checksum-docs + +install-inline-checksum: @printf "Installing inline-checksum to %s/bin...\n" $(DESTDIR)$(PREFIX) - @install -Dm 755 inline-checksum $(DESTDIR)$(PREFIX)/bin/inline-checksum - @install -Dm 644 inline-checksum-completion $(DESTDIR)$(BASH_COMP_DIR)/inline-checksum - @install -Dm 644 inline-checksum-completion $(DESTDIR)$(ZSH_COMP_DIR)/_inline-checksum + @$(INSTALL) -Dm 755 inline-checksum $(DESTDIR)$(PREFIX)/bin/inline-checksum + +install-inline-checksum-info: info + @printf "Installing inline-checksum bash completion to %s...\n" $(DESTDIR)$(BASH_COMP_DIR) + @$(INSTALL) -Dm 644 docs/inline-checksum-completion $(DESTDIR)$(BASH_COMP_DIR)/inline-checksum + @printf "Installing inline-checksum zsh completion to %s...\n" $(DESTDIR)$(ZSH_COMP_DIR) + @$(INSTALL) -Dm 644 docs/inline-checksum-completion $(DESTDIR)$(ZSH_COMP_DIR)/_inline-checksum + @printf "Installing inline-checksum man page to %s...\n" $(DESTDIR)$(MAN1DIR) + -@$(INSTALL) -Dm 644 docs/inline-checksum.1 $(DESTDIR)$(MAN1DIR)/inline-checksum.1 + -@gzip $(DESTDIR)$(MAN1DIR)/inline-checksum.1 + -@mandb -q uninstall: @printf "Uninstalling inline-checksum from %s/bin...\n" $(DESTDIR)$(PREFIX) @$(RM) $(DESTDIR)$(PREFIX)/bin/inline-checksum @$(RM) $(DESTDIR)$(BASH_COMP_DIR)/inline-checksum @$(RM) $(DESTDIR)$(ZSH_COMP_DIR)/_inline-checksum + @$(RM) $(DESTDIR)$(MAN1DIR)/inline-checksum.1 + -@mandb -q From 990849ca8287b247e534acdd6d38fd86256660f7 Mon Sep 17 00:00:00 2001 From: Josh Beale Date: Wed, 10 Jun 2026 21:23:11 -0400 Subject: [PATCH 6/9] Bumped version to 1.2.0 --- inline-checksum | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inline-checksum b/inline-checksum index beb2f25..2af4d47 100755 --- a/inline-checksum +++ b/inline-checksum @@ -55,7 +55,7 @@ # ------------------------------------- # _program_name="$(basename "${0}")" -_version="1.1.2" +_version="1.2.0" usage() { cat <<-EOF From cb1d7f85b3af7ff61ab4ae99b3c69c0479a89d9e Mon Sep 17 00:00:00 2001 From: Josh Beale Date: Wed, 10 Jun 2026 21:28:00 -0400 Subject: [PATCH 7/9] Updated make clean target to clean up old man pages in docs/ and patched a bug where make info would not use local script to generate info --- Makefile | 9 +++++++-- docs/inline-checksum.1 | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index a6834e4..66e20a8 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,12 @@ ifneq ($(wildcard tests/*.log),) @printf "Cleaning up test logs.\n" @$(RM) tests/*.log else - @printf "Nothing to clean.\n" + @printf "No test logs to clean.\n" +endif +ifneq ($(wildcard docs/*.1),) + @$(RM) docs/*.1 +else + @printf "No man pages to clean.\n" endif test: @@ -40,7 +45,7 @@ test: [ "$$FAILURE" -eq 0 ] || exit 1 info: - @help2man inline-checksum -o docs/inline-checksum.1 + @help2man ./inline-checksum -o docs/inline-checksum.1 install: install-inline-checksum install-inline-checksum-docs diff --git a/docs/inline-checksum.1 b/docs/inline-checksum.1 index a332ee2..b96c55f 100644 --- a/docs/inline-checksum.1 +++ b/docs/inline-checksum.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH INLINE-CHECKSUM "1" "June 2026" "Inline-Checksum 1.1.2" "User Commands" +.TH INLINE-CHECKSUM "1" "June 2026" "Inline-Checksum 1.2.0" "User Commands" .SH NAME -Inline-Checksum \- manual page for Inline-Checksum 1.1.2 +Inline-Checksum \- manual page for Inline-Checksum 1.2.0 .SH SYNOPSIS .B inline-checksum [\fI\,-h|V\/\fR] \fI\,| \/\fR[\fI\,-x\/\fR] [\fI\,-a\/\fR[\fI\,=| \/\fR]\fI\,\/\fR] \fI\, \/\fR[\fI\,TARGET_FILE\/\fR] From 2deb2c78a36afe68cb286881bbad8a1f56d96a9d Mon Sep 17 00:00:00 2001 From: Josh Beale Date: Thu, 11 Jun 2026 09:39:30 -0400 Subject: [PATCH 8/9] Updated make install target and gzipped man page --- Makefile | 14 ++++++++------ docs/inline-checksum.1.gz | Bin 0 -> 1052 bytes 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 docs/inline-checksum.1.gz diff --git a/Makefile b/Makefile index 66e20a8..9d334e1 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ else @printf "No test logs to clean.\n" endif ifneq ($(wildcard docs/*.1),) + @printf "Cleaning up man pages.\n" @$(RM) docs/*.1 else @printf "No man pages to clean.\n" @@ -47,7 +48,7 @@ test: info: @help2man ./inline-checksum -o docs/inline-checksum.1 -install: install-inline-checksum install-inline-checksum-docs +install: install-inline-checksum install-inline-checksum-info install-inline-checksum: @printf "Installing inline-checksum to %s/bin...\n" $(DESTDIR)$(PREFIX) @@ -59,14 +60,15 @@ install-inline-checksum-info: info @printf "Installing inline-checksum zsh completion to %s...\n" $(DESTDIR)$(ZSH_COMP_DIR) @$(INSTALL) -Dm 644 docs/inline-checksum-completion $(DESTDIR)$(ZSH_COMP_DIR)/_inline-checksum @printf "Installing inline-checksum man page to %s...\n" $(DESTDIR)$(MAN1DIR) - -@$(INSTALL) -Dm 644 docs/inline-checksum.1 $(DESTDIR)$(MAN1DIR)/inline-checksum.1 - -@gzip $(DESTDIR)$(MAN1DIR)/inline-checksum.1 - -@mandb -q + @$(INSTALL) -Dm 644 docs/inline-checksum.1 $(DESTDIR)$(MAN1DIR)/inline-checksum.1 + @gzip $(DESTDIR)$(MAN1DIR)/inline-checksum.1 + -@mandb > /dev/null 2>&1 uninstall: @printf "Uninstalling inline-checksum from %s/bin...\n" $(DESTDIR)$(PREFIX) + @printf "Uninstalling inline-checksum documentation from %s...\n" $(DESTDIR)$(PREFIX) @$(RM) $(DESTDIR)$(PREFIX)/bin/inline-checksum @$(RM) $(DESTDIR)$(BASH_COMP_DIR)/inline-checksum @$(RM) $(DESTDIR)$(ZSH_COMP_DIR)/_inline-checksum - @$(RM) $(DESTDIR)$(MAN1DIR)/inline-checksum.1 - -@mandb -q + @$(RM) $(DESTDIR)$(MAN1DIR)/inline-checksum.1.gz + -@mandb > /dev/null 2>&1 diff --git a/docs/inline-checksum.1.gz b/docs/inline-checksum.1.gz new file mode 100644 index 0000000000000000000000000000000000000000..5dd57a27abeac9d5869d6d9e38a34e5cd3eaf2bd GIT binary patch literal 1052 zcmV+%1mpW3iwFqXsVZs!18Ht-X>MgLV`yb#YjbsNE-?VDRb6k}HWYo=uekF|_FyZG zyA+t=8gm>qR%cs=rFIJ$npfk3lyGDJ_PhPww(MXD?q=m~ zoY7+GEdKPrtYL67fWhawq%eLr{(xh*%vniCi;PC!WL@ClvHcF$zep-z!3zY8<-oH2 zC2Zzv$ND)w907*ZB!`Nm6cR4rO-O^_KW@CO@A{T~2ds&T+9>NOOx$od$}V5S>oD2v z!OSmUX6@#w-D;<#xA(D)+?&~SzIyO>Zm?X>`e@URhglysnC~8(;2%wG6Krz5cl^c9 z-3G3=u@)qc>KuudK%mRm)Ji}Rkx~Un6GXhIh`=DGKylow1b=2R%F~^(4YX%ak%eGu zg~?qw%J9}9m?2J3N1R)J#*d&fCXKRCP$@OT`XYK_%6>imwSWAX3dwl+g3!*9Z_KwK zN{`>bAbkvyr(7_V6}SjJF0CNL1iDSAC6bh%1Fm%)`WW`I#4teA2D5s=E z1gI-y@T~VSWxb$iQE@@U*#OF3rue6YP`uJ+h)_cvA2odix&r|HQy1obG=~p^EtgEI zge^7iwk87u`RZSz#ETP2N_0_JCX2F85p-gc$WzbYdvnl~-4pIdQ`_JsKn@ZwHVTC! zlu96DXzbF^DtG}>#jI@n?EF1nZ&wZ)+TB`FEpmJn66vpCisKnv+FlP|njIT>bkc3y z_u3P-@P688e`zdoL37OZFzwFG;OPP~L-@V9>;J=@YD#{9$GR5Y_HpMvECXx7tFvHf zrXc(^;^ysy&m2SVC_yTx{~q*zTz>yYS`e1o$n4CvRxF}rL}Bd)6PRX7RdRBD9Wy~A z#l_i9WMXrXULV;vc5Q+soj9k8sF`IS1Zssg#9tyP1<4b2L{TSj<~6#8Hp^PZjFj!m zAZW~_66~O5)eVkvVZG%ARRMXQX?x W<3;yHPLaVjU+X&w%*$Vn2LJ%@9{w2s literal 0 HcmV?d00001 From 1e34c0216920f5f1e77e3d3748a92d8aff5f7891 Mon Sep 17 00:00:00 2001 From: Josh Beale Date: Thu, 11 Jun 2026 10:47:05 -0400 Subject: [PATCH 9/9] Updated make targets to use pre gzipped man page --- Makefile | 8 +++--- docs/inline-checksum.1 | 55 -------------------------------------- docs/inline-checksum.1.gz | Bin 1052 -> 1052 bytes 3 files changed, 4 insertions(+), 59 deletions(-) delete mode 100644 docs/inline-checksum.1 diff --git a/Makefile b/Makefile index 9d334e1..d93d569 100644 --- a/Makefile +++ b/Makefile @@ -24,9 +24,9 @@ ifneq ($(wildcard tests/*.log),) else @printf "No test logs to clean.\n" endif -ifneq ($(wildcard docs/*.1),) +ifneq ($(wildcard docs/*.1.gz),) @printf "Cleaning up man pages.\n" - @$(RM) docs/*.1 + @$(RM) docs/*.1.gz else @printf "No man pages to clean.\n" endif @@ -47,6 +47,7 @@ test: info: @help2man ./inline-checksum -o docs/inline-checksum.1 + @gzip docs/inline-checksum.1 install: install-inline-checksum install-inline-checksum-info @@ -60,8 +61,7 @@ install-inline-checksum-info: info @printf "Installing inline-checksum zsh completion to %s...\n" $(DESTDIR)$(ZSH_COMP_DIR) @$(INSTALL) -Dm 644 docs/inline-checksum-completion $(DESTDIR)$(ZSH_COMP_DIR)/_inline-checksum @printf "Installing inline-checksum man page to %s...\n" $(DESTDIR)$(MAN1DIR) - @$(INSTALL) -Dm 644 docs/inline-checksum.1 $(DESTDIR)$(MAN1DIR)/inline-checksum.1 - @gzip $(DESTDIR)$(MAN1DIR)/inline-checksum.1 + @$(INSTALL) -Dm 644 docs/inline-checksum.1.gz $(DESTDIR)$(MAN1DIR)/inline-checksum.1.gz -@mandb > /dev/null 2>&1 uninstall: diff --git a/docs/inline-checksum.1 b/docs/inline-checksum.1 deleted file mode 100644 index b96c55f..0000000 --- a/docs/inline-checksum.1 +++ /dev/null @@ -1,55 +0,0 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH INLINE-CHECKSUM "1" "June 2026" "Inline-Checksum 1.2.0" "User Commands" -.SH NAME -Inline-Checksum \- manual page for Inline-Checksum 1.2.0 -.SH SYNOPSIS -.B inline-checksum -[\fI\,-h|V\/\fR] \fI\,| \/\fR[\fI\,-x\/\fR] [\fI\,-a\/\fR[\fI\,=| \/\fR]\fI\,\/\fR] \fI\, \/\fR[\fI\,TARGET_FILE\/\fR] -.SH DESCRIPTION -Calculates a checksum for a target and compares it to a provided checksum. -.SH OPTIONS -.TP -\fB\-h\fR, \fB\-\-help\fR -Show this help message and exit. -.TP -\fB\-V\fR, \fB\-\-version\fR -Show version information and exit. -.TP -\fB\-a\fR, \fB\-\-algorithm\fR -The algorithm used to compute the checksum. Accepts one of 'sha256', 'sha512', or 'md5'. Defaults to 'sha256' if unspecified. -.TP -\fB\-x\fR, \fB\-\-output\-filename\fR -Output filename when piping, instead of file contents. The caller is responsible for cleaning up any resulting temporary files. -.TP -\fB\-\-\fR -Stop processing command line arguments. -.SS "Positional Arguments:" -.TP - -The checksum against which to compare. -.TP -[TARGET_FILE] -The file to compute a checksum for. If absent or '\-', reads input from stdin. -.SH EXAMPLES -.IP -curl \-fsSL | inline\-checksum [\-x] [\-\-algorithm[=| ]] [| sh \-] -.IP -inline\-checksum [\-x] [\-\-algorithm[=| ]] [| sh \-] -.SH COPYRIGHT -Copyright \(co 2026 Josh Beale . -Licence MIT: -.br -This is free software: you are free to change and redistribute it. -There is NO WARRANTY, to the extent permitted by law. -.SH "SEE ALSO" -The full documentation for -.B Inline-Checksum -is maintained as a Texinfo manual. If the -.B info -and -.B Inline-Checksum -programs are properly installed at your site, the command -.IP -.B info Inline-Checksum -.PP -should give you access to the complete manual. diff --git a/docs/inline-checksum.1.gz b/docs/inline-checksum.1.gz index 5dd57a27abeac9d5869d6d9e38a34e5cd3eaf2bd..c1a063147514152239b606357ba0f307b851abf5 100644 GIT binary patch delta 15 WcmbQkF^7XqzMF%C`_x7@F%|$H`~$B5 delta 15 WcmbQkF^7XqzMF&N*2;}+Vk`h8F$7%z