X-Git-Url: http://git.tuebingen.mpg.de/?p=gsu.git;a=blobdiff_plain;f=subcommand;h=956fb5c865ad3ae780ac7344917345879380aa8e;hp=a07f4145c69adb6fa319dbdaa9c97e3b0a2d5cde;hb=46d356bc055978057542e999892ec6e0cf1c0153;hpb=e08a602e71ba1f9c9bb8e1c493cb4109fc22e952 diff --git a/subcommand b/subcommand index a07f414..956fb5c 100644 --- a/subcommand +++ b/subcommand @@ -187,6 +187,8 @@ _gsu_print_available_commands() # Print all options of the given optstring to stdout if the word in the current # command line begins with a hyphen character. +# +# Returns 0 if the current word does not start with a hyphen, one otherwise. gsu_complete_options() { local opts="$1" cword="$2" cur opt @@ -198,13 +200,12 @@ gsu_complete_options() ret=0 [[ ! "$cur" == -* ]] && return - ret=0 for ((i=0; i < ${#opts}; i++)); do opt="${opts:$i:1}" [[ "$opt" == ":" ]] && continue printf "%s" "-$opt " - let ret++ done + ret=1 } com_prefs_options='e'