aboutsummaryrefslogtreecommitdiff
path: root/bin/clamp
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-08-12 18:46:42 -0300
committerEuAndreh <eu@euandre.org>2022-08-12 18:46:42 -0300
commitc0ed55485e8db03673318f67dd06e7a04435c0f9 (patch)
tree932fc598a77c8c0fd39cfc17242ea3f970e6c5d8 /bin/clamp
parentetc/git/ignore: Always exclude tmp/ directory (diff)
downloaddotfiles-c0ed55485e8db03673318f67dd06e7a04435c0f9.tar.gz
dotfiles-c0ed55485e8db03673318f67dd06e7a04435c0f9.tar.xz
bin/{min,max,clamp}: Add "Examples" section to help string
Diffstat (limited to 'bin/clamp')
-rwxr-xr-xbin/clamp19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/clamp b/bin/clamp
index a40b823..652c978 100755
--- a/bin/clamp
+++ b/bin/clamp
@@ -15,7 +15,26 @@ help() {
Options:
-h, --help show this message
+
Clamp the NUMBER between MIN and MAX.
+
+
+ Examples:
+
+ Assert the number is within the interval:
+
+ $ clamp 5 3 9
+ 5
+
+ When a number is below MIN it gets clamped:
+
+ $ clamp 1 3 9
+ 3
+
+ When a number is above MAX it gets clamped:
+
+ $ clamp 15 3 9
+ 9
EOF
}