From a95c249fbc6b556270d91b685b980f0cec986b23 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 31 Jul 2012 21:34:03 -0400 Subject: Add oh_usage and support oh-* utils in oh_help. --- (limited to 'lib') diff --git a/lib/messages.sh b/lib/messages.sh index 3894778..c2c381e 100644 --- a/lib/messages.sh +++ b/lib/messages.sh @@ -64,9 +64,19 @@ oh_info() return 0 } +oh_usage() +{ + _util="$(echo "${0##*/}" | sed 's/-/_/g')" + _usage_str="$(eval echo "\$\{oh_str_usage_${_util}\}")" + : "${_usage_str:=${oh_str_usage_none}}" + printf '%s\n' "${_usage_str}" +} + oh_help() { - _help_str="$(eval echo "\$\{oh_str_help_${0##*/}\}")" + oh_usage + _util="$(echo "${0##*/}" | sed 's/-/_/g')" + _help_str="$(eval echo "\$\{oh_str_help_${_util}\}")" : "${_help_str:=${oh_str_help_none}}" printf '%s\n' "${_help_str}" } -- cgit v0.9.1