sbs

A Simple Blogging System.
git clone https://git.sr.ht/~jbauer/sbs
Log | Files | Refs | README | LICENSE

commit 4fb81b9cc7e4aa06565f3f120ff399d518081fe4
parent e5b24b78d3561ac9c48b1f3d6598e0d43dcca8ea
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Tue, 22 Feb 2022 14:58:51 -0500

Add helptext printout

Diffstat:
Msbs | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/sbs b/sbs @@ -5,14 +5,19 @@ # Copyright (C) 2022 Jake Bauer # Licensed under the terms of the ISC License, see LICENSE for details. -set -o errexit -set -o nounset - if [ ! -x "$(command -v lowdown)" ]; then echo "The program 'lowdown' is needed but was not found." exit 1 fi +if [ -z "$1" ] || [ "$1" = "help" ] || [ "$1" = -h ] || [ "$1" = "--help" ]; then + echo "Usage: sbs <command> [FILE ...]" + exit 0 +fi + +set -o errexit +set -o nounset + # Note: The script does not run measurably faster if files are written to using # one versus many printfs. Therefore, I use many printf statements to ease # reading, understanding, and modification of the code.