} | sort | tr '\n' ' ')"
}
+# Check number of arguments.
+#
+# Usage: gsu_check_arg_count <num_given> <num1> [<num2>]
+#
+# Check that <num_given> is between <num1> and <num2> inclusively.
+# If only <num1> ist given, num2 is assumed to be infinity.
+#
+# Examples:
+# 0 0 no argument allowed
+# 1 1 exactly one argument required
+# 0 2 at most two arguments admissible
+# 2 at least two arguments required
+gsu_check_arg_count()
+{
+ ret=-$E_GSU_BAD_ARG_COUNT
+ if (($# == 2)); then # only num1 is given
+ result="at least $2 args required, $1 given"
+ (($1 < $2)) && return
+ ret=$GSU_SUCCESS
+ return
+ fi
+ # num1 and num2 given
+ result="need at least $2 args, $1 given"
+ (($1 < $2)) && return
+ result="need at most $3 args, $1 given"
+ (($1 > $3)) && return
+ ret=$GSU_SUCCESS
+}
+
_gsu_print_available_commands()
{
local cmd cmds
_gsu_print_available_commands
exit 1
}
-
-# Check number of arguments.
-#
-# Usage: gsu_check_arg_count <num_given> <num1> [<num2>]
-#
-# Check that <num_given> is between <num1> and <num2> inclusively.
-# If only <num1> ist given, num2 is assumed to be infinity.
-#
-# Examples:
-# 0 0 no argument allowed
-# 1 1 exactly one argument required
-# 0 2 at most two arguments admissible
-# 2 at least two arguments required
-gsu_check_arg_count()
-{
- ret=-$E_GSU_BAD_ARG_COUNT
- if (($# == 2)); then # only num1 is given
- result="at least $2 args required, $1 given"
- (($1 < $2)) && return
- ret=$GSU_SUCCESS
- return
- fi
- # num1 and num2 given
- result="need at least $2 args, $1 given"
- (($1 < $2)) && return
- result="need at most $3 args, $1 given"
- (($1 > $3)) && return
- ret=$GSU_SUCCESS
-}