changeset 778:4603fa1a5724

Make reagent pouch subcommands more tolerating of whitespace.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 15 Jul 2008 10:40:20 +0000
parents 460d676393ed
children ef7ec8837221
files ggrtf-rpouch.tf
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ggrtf-rpouch.tf	Tue Jul 15 10:32:56 2008 +0000
+++ b/ggrtf-rpouch.tf	Tue Jul 15 10:40:20 2008 +0000
@@ -224,7 +224,7 @@
 ;; Main command interface
 /def -i rpouch =\
 	/let _args=$[tolower({*})]%;\
-	/if (regmatch("^(fill|check) ([A-Za-z0-9_-]+) from ([A-Za-z0-9_ -]+)$", _args))\
+	/if (regmatch("^(fill|check) +([A-Za-z0-9_-]+) +from +([A-Za-z0-9_][A-Za-z0-9_ -]+)$", _args))\
 		/set rpouch_mode=%{P1}%;\
 		/set rpouch_to=%{P2}%;\
 		/set rpouch_from=%{P3}%;\
@@ -241,7 +241,7 @@
 		/set rpouch_name=from%;\
 		/set rpouch_target=%{rpouch_from}%;\
 		@@look at %{rpouch_from}%;\
-	/elseif (regmatch("^(rset|set) ([A-Za-z ]+) to ([0-9]+)$", _args))\
+	/elseif (regmatch("^(rset|set) +([A-Za-z][A-Za-z ]+) to ([0-9]+)$", _args))\
 		/if ({P1}=~"set")\
 			/let _tmps=$[replace(" ","_",tolower({P2}))]%;\
 			/eval /set _rpas=$$[rpouch_reg_%{_tmps}]%;\
@@ -254,9 +254,9 @@
 		/else \
 			/gerror This setting does not work yet!%;\
 		/endif%;\
-	/elseif (regmatch("^adjust ([0-9]+)$", _args))\
+	/elseif (regmatch("^adjust +([0-9]+)$", _args))\
 		/grpouch_adjust %{P1} %{rpouch_regs}%;\
-	/elseif (regmatch("^all ([0-9]+)$", _args))\
+	/elseif (regmatch("^all +([0-9]+)$", _args))\
 		/grpouch_set_all %{P1} %{rpouch_regs}%;\
 	/elseif (_args=~"list")\
 		/grpouch_list %{rpouch_regs}%;\