Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit0c33b774ae37c9aaf64cdd6aa85b26c526a14192 (patch)
Author
 Syndamia <kamen@syndamia.com>
2024-07-23 09:16:35 +0300
Committer
 Syndamia <kamen@syndamia.com>
2024-07-23 09:16:35 +0300
Files3602bbfeafbd0c8a8f852899b6ecf47c2dabac2d
csg-0c33b774ae37c9aaf64cdd6aa85b26c526a14192.tar
csg-0c33b774ae37c9aaf64cdd6aa85b26c526a14192.tar.gz
csg-0c33b774ae37c9aaf64cdd6aa85b26c526a14192.zip
Parent07a8ef9e92904678df329ede995a459ae252adbf (diff)
(csg) On error only part of help is printed, added info about exit codes
1 files changed, 9 insertions, 2 deletions
-rwxr-xr-xcsg11
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 <source_dir> <destination_dir> <title_format> <base_url> [<scripts_dir>]
+ csg <source_dir> <destination_dir> <title_format> <base_url> [<scripts_dir>]'
+ [ $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