]> git.tuebingen.mpg.de Git - gsu.git/commitdiff
Allow hyphens in command names.
authorAndre Noll <maan@systemlinux.org>
Tue, 2 Aug 2011 13:12:48 +0000 (15:12 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 29 Aug 2014 19:39:58 +0000 (21:39 +0200)
There is no reason to forbid subcommands with hyphens, and sometimes
it is just natural have such a command. For instance if the subcommand
wraps an existing command with a hyphen like "apt-get".

So change the regular expression for subcommands accordingly.

funcs/gsu

index 63e0acf7dfb705047efb1f4809c9af3282fbe9a3..1a35fca523b5084455e2a25c24e87fcbe0e08d97 100644 (file)
--- a/funcs/gsu
+++ b/funcs/gsu
@@ -139,7 +139,7 @@ export -f _gsu_usage
 
 # Each line matching this is recognized as a subcommand. The name
 # of the subcommand is the first subexpression.
-export gsu_command_regex='^com_\([a-zA-Z_0-9]\+\)()'
+export gsu_command_regex='^com_\([-a-zA-Z_0-9]\+\)()'
 
 _gsu_available_commands()
 {