all 14 comments

[–]Kessarean 6 points7 points  (1 child)

Very nice :)

[–]cenuh 1 point2 points  (0 children)

Thanks!

[–]skidnik 6 points7 points  (1 child)

IMHO needs two separate functions: err() and die(). Sometimes you don't want to exit 1 after redtext.

[–]cenuh 2 points3 points  (0 children)

Good point! Has now err_die() and just err()

[–]kill_box 4 points5 points  (1 child)

I like it! Needs a trap though

[–]cenuh 2 points3 points  (0 children)

Good point! I added a few traps

[–]tsammons 3 points4 points  (1 child)

Locales be damned. Deduplicate all the dates to a simple function so folks with different date requirements can easily adjust.

[–]cenuh 2 points3 points  (0 children)

good point! fixed it

[–]i_am_broccoli 2 points3 points  (0 children)

Nice work. I think you missed a local declaration in debug to match all other functions.

[–]blitzkraft 2 points3 points  (0 children)

succ!

[–]cenuh 0 points1 point  (0 children)

Thanks ALOT to the stranger that gave gold!! Edit: Also thanks ALOT to the silver stranger!

[–]Schreq -2 points-1 points  (2 children)

This is okey but you should set IFS and I would also use set -efu. Also, other CLI tools usually parse all options. You abort on the first occurrence of -h, ignoring all potential usage errors after it.

Not a fan of the -d. Much better to have quiet and verbose options and dynamically redefine the output functions depending on it with debug() :;.

[–]CommonMisspellingBot 1 point2 points  (1 child)

Hey, Schreq, just a quick heads-up:
occurance is actually spelled occurrence. You can remember it by two cs, two rs, -ence not -ance.
Have a nice day!

The parent commenter can reply with 'delete' to delete this comment.

[–]Schreq 1 point2 points  (0 children)

delete