diff options
-rw-r--r-- | libs/default.eselect.in | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libs/default.eselect.in b/libs/default.eselect.in index ef59056..6fbe20e 100644 --- a/libs/default.eselect.in +++ b/libs/default.eselect.in @@ -28,13 +28,15 @@ do_usage() { } show_usage_message() { + local action + echo "Usage: ${ESELECT_COMMAND} <action> <options>" echo write_list_start "Standard actions:" - for action in "help" "usage" "version" ; do + for action in help usage version; do local desc="" - is_function "describe_${action}" && desc=$(describe_${action} ) + is_function "describe_${action}" && desc=$(describe_${action}) write_kv_list_entry "${action}" "${desc:-(no description)}" done @@ -45,16 +47,16 @@ show_usage_message() { for action in $(set | \ sed -n -e '/^do_\S\+ ()\s*$/s/^do_\(\S\+\).*/\1/p' | \ grep -v 'action' | \ - sort ) ; do + sort); do case "${action}" in help|usage|version) continue ;; ?*) - local desc="" line="" ifs_save="${IFS}" action_text="" - is_function "describe_${action}" && desc=$(describe_${action} ) + local desc="" ifs_save="${IFS}" action_text line + is_function "describe_${action}" && desc=$(describe_${action}) - if is_function "describe_${action}_parameters" ; then + if is_function "describe_${action}_parameters"; then action_text="${action} $(describe_${action}_parameters)" else action_text="${action}" @@ -62,9 +64,9 @@ show_usage_message() { write_kv_list_entry "${action_text}" "${desc:-(no description)}" - if is_function "describe_${action}_options" ; then + if is_function "describe_${action}_options"; then IFS=$'\n' - for line in $(describe_${action}_options) ; do + for line in $(describe_${action}_options); do write_kv_list_entry -p \ " ${line%%*( ):*}" \ " ${line##+([^:]):*( )}" @@ -93,7 +95,7 @@ do_help() { set_output_mode default echo "${DESCRIPTION}" show_usage_message - if is_function show_extra_help_text ; then + if is_function show_extra_help_text; then echo show_extra_help_text fi |