IDENT=" "
-function cli_help_requested() {
+cli_help_requested() {
local argument="${1}"
if [ -n "${argument}" ]; then
return ${EXIT_FALSE}
}
-function cli_run_help() {
+cli_run_help() {
local command="$@"
print "Run \"${command} help\" to get more information."
return ${EXIT_OK}
}
-function cli_device_headline() {
+cli_device_headline() {
local device=${1}
assert isset device
fi
}
-function cli_device_stats() {
+cli_device_stats() {
local level=${1}
local device=${2}
cli_space
}
-function cli_device_vlan() {
+cli_device_vlan() {
local device=${1}
cli_headline 2 "VLAN"
cli_space
}
-function cli_device_bonded() {
+cli_device_bonded() {
local device=${1}
cli_headline 2 "Bonding information"
cli_space
}
-function cli_device_bonding() {
+cli_device_bonding() {
local device=${1}
assert isset device
cli_space
}
-function cli_headline() {
+cli_headline() {
local level=${1}
local format=${2}
shift 2
printf "${out}"
}
-function cli_statusline() {
+cli_statusline() {
local level=${1}
shift
cli_print $(( ${level} - 1 )) "%-12s %s" "${head}" "$@"
}
-function cli_print() {
+cli_print() {
local level=${1}
local format=${2}
shift 2
printf "${out}"
}
-function cli_print_fmt1() {
+cli_print_fmt1() {
local level=${1}
shift
cli_print ${level} "${format}" "$@"
}
-function cli_print_bool() {
+cli_print_bool() {
if [ "${1}" = "${EXIT_TRUE}" ]; then
echo "true"
else
fi
}
-function cli_print_yesno() {
+cli_print_yesno() {
if [ "${1}" = "${EXIT_TRUE}" ]; then
echo "yes"
else
fi
}
-function cli_print_enabled() {
+cli_print_enabled() {
enabled ${1}
cli_print_bool $?
}
-function cli_print_warning() {
+cli_print_warning() {
local level=${1}
shift
cli_print ${level} "${CLR_YELLOW_B}%s${CLR_RESET}" "$@"
}
-function cli_space() {
+cli_space() {
printf "\n"
}
-function cli_ident() {
+cli_ident() {
local level=${1}
assert isinteger level
print "${ident}"
}
-function cli_yesno() {
+cli_yesno() {
local message="$@ [y/n] "
local yesno
done
}
-function cli_get_key() {
+cli_get_key() {
local key="${1%%=*}"
echo "${key/--/}"
}
-function cli_get_val() {
+cli_get_val() {
echo "${@#*=}"
}
-function cli_get_bool() {
+cli_get_bool() {
local value="$(cli_get_val "$@")"
if enabled value; then
return ${EXIT_FALSE}
}
-function cli_usage() {
+cli_usage() {
local command="$@"
local basename="$(basename ${0})"
echo "Please run '${command}' for detailed help." >&2
}
-function cli_show_man() {
+cli_show_man() {
local manpage=${1}
assert isset manpage