aboutsummaryrefslogtreecommitdiff
path: root/bin/clamp
diff options
context:
space:
mode:
Diffstat (limited to 'bin/clamp')
-rwxr-xr-xbin/clamp7
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/clamp b/bin/clamp
index fab6967..a2c8bee 100755
--- a/bin/clamp
+++ b/bin/clamp
@@ -12,9 +12,14 @@ usage() {
help() {
cat <<-'EOF'
+
Options:
-h, --help show this message
+ NUMBER the number to be clamped
+ MIN lower bound
+ MAX upper bound
+
Clamp the NUMBER between MIN and MAX.
@@ -26,11 +31,13 @@ help() {
$ 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