From c0ed55485e8db03673318f67dd06e7a04435c0f9 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 12 Aug 2022 18:46:42 -0300 Subject: bin/{min,max,clamp}: Add "Examples" section to help string --- bin/clamp | 19 +++++++++++++++++++ bin/max | 23 +++++++++++++++++++++++ bin/min | 24 ++++++++++++++++++++++++ 3 files changed, 66 insertions(+) (limited to 'bin') 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 } diff --git a/bin/max b/bin/max index 84585ee..ae38983 100755 --- a/bin/max +++ b/bin/max @@ -16,6 +16,29 @@ help() { -h, --help show this message Get the maximum number from the given values. + + + Examples: + + Get the maximum number from a list: + + $ min 5 3 9 9 4 + 9 + + Get the maximum number when negative numbers are given + + $ max -- -3 -5 + -3 + + Get the maximum number given a single number + + $ max 8 + 8 + + The maximum default number: + + $ max + 0 EOF } diff --git a/bin/min b/bin/min index 7868623..715f4d1 100755 --- a/bin/min +++ b/bin/min @@ -15,7 +15,31 @@ help() { Options: -h, --help show this message + Get the minimun number from the given values. + + + Examples: + + Get the minimum number from a list: + + $ min 5 3 9 9 4 + 3 + + Get the minimum number when negative numbers are given + + $ min -- -3 -5 + -5 + + Get the minimum number given a single number + + $ min 8 + 8 + + The minimum default number: + + $ min + 0 EOF } -- cgit v1.2.3