From 0c33b774ae37c9aaf64cdd6aa85b26c526a14192 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 23 Jul 2024 09:16:35 +0300 Subject: (csg) On error only part of help is printed, added info about exit codes --- csg | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/csg b/csg index 1a6082d..fc1119a 100755 --- a/csg +++ b/csg @@ -6,8 +6,10 @@ csg_help() { echo 'Usage: csg [-h | -? | --help] - csg [] + csg []' + [ $1 -ne 0 ] && exit $1 + echo ' Options: -h, -?, --help Print this help message (also available when given no arguments) @@ -33,10 +35,15 @@ Variables (you can predefine): Dependencies (required): POSIX shell, realpath, dirname, find, cpio +Exit codes: + 1 Invalid argument + 2 No read/write access + 3 Blank argument + 4 Dependency not found csg - complicated (static) site generator Created by Syndamia, https://gitlab.com/Syndamia/csg' - exit $1 + exit 0 } [ -z "$1" -o "$1" = '-h' -o "$1" = '-?' -o "$1" = '--help' ] && csg_help 0 -- cgit v1.3.1-26-gb76a