]> git.tuebingen.mpg.de Git - gsu.git/blobdiff - subcommand
subcommand: Use POSIX compatible command regex.
[gsu.git] / subcommand
index 3ff31f0a6492e6d3420d533de96d9e02e358825a..ca546bd1617074d86813135f54c9dc2f7f7e5873 100644 (file)
@@ -25,7 +25,7 @@ _gsu_usage()
 # exactly one parenthesized subexpression for matching the command name.
 _gsu_get_command_regex()
 {
-       local cmd="${1:-[-a-zA-Z_0-9]+}"
+       local cmd="${1:-[-a-zA-Z_0-9]{1,\}}"
        result="^com_($cmd)\(\)"
 }
 
@@ -549,6 +549,7 @@ gsu()
        # external commands
        for i in $gsu_cmds; do
                if test "$arg" = "$i"; then
+                       ret=$GSU_SUCCESS
                        com_$arg "$@"
                        if (("$ret" < 0)); then
                                gsu_err_msg