diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-03-01 19:30:33 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-03-01 19:30:33 +0200 |
commit | 3ca95b33f2dc650b384a96dc1d3aa3d8d18553d1 (patch) | |
tree | 83dcd8a473d78788e852bccfc3b187ab7b54e466 /bin/ak-logthis | |
parent | f8d2236e55e5c369b218017d1de1058d6a8ee361 (diff) | |
download | arching-kaos-tools-3ca95b33f2dc650b384a96dc1d3aa3d8d18553d1.tar.gz arching-kaos-tools-3ca95b33f2dc650b384a96dc1d3aa3d8d18553d1.tar.bz2 arching-kaos-tools-3ca95b33f2dc650b384a96dc1d3aa3d8d18553d1.zip |
Changes help subcommand to flag style -h, --help
Diffstat (limited to 'bin/ak-logthis')
-rwxr-xr-x | bin/ak-logthis | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/ak-logthis b/bin/ak-logthis index 2ac3d80..b225313 100755 --- a/bin/ak-logthis +++ b/bin/ak-logthis @@ -1,10 +1,18 @@ #!/bin/bash +PROGRAM="$(basename $0)" TS="$(date -u +%s)" -if [ ! -z "$1" ] +if [ ! -z $1 ] && [ -n "$1" ] then - if [ ! -z "$2" ] + if [ "$1" == "-h" ] || [ "$1" == "--help" ] then - if [ ! -z "$3" ] + echo "$PROGRAM - Log events" + echo "-h, --help Prints this message" + echo "<program> <type> <message> Logs this message" + exit 0 + fi + if [ ! -z "$2" ] && [ -n "$2" ] + then + if [ ! -z "$3" ] && [ -n "$3" ] then echo "$TS" "<$1>" "[$2]" "$3" >> $AK_LOGSFILE if [ "$AK_DEBUG" == "yes" ] |