changeset 617:ce7a666991e3

tj: Cleanup, set rindex only once.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 10 Feb 2021 13:36:56 +0200
parents 20dba2c757de
children 3b1fdba9a95c
files tj.tcl
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tj.tcl	Wed Feb 10 13:36:31 2021 +0200
+++ b/tj.tcl	Wed Feb 10 13:36:56 2021 +0200
@@ -208,6 +208,7 @@
   # Check and handle arguments
   set rarglist [::textutil::split::splitx $uargs {\s+}]
   set rcmd [lindex $rarglist 0]
+  set rindex 1
 
   if {[tj_cmd_match "help" $rcmd]} {
     # Show help
@@ -217,7 +218,6 @@
     return 1
   } elseif {[tj_cmd_match "set" $rcmd]} {
     # !tj set [#id] <[-/+]days [[+/-]<hours>] | dd.mm.yyyy [hh:mm]> [<desc>]
-    set rindex 1
     if {![utl_arg_get $rarglist rindex rarg 0]} {
       tj_msg $upublic $unick $uchan "help_set"
       return 1
@@ -407,7 +407,6 @@
   } elseif {[tj_cmd_match "show" $rcmd]} {
     # !tj show [#id] <name>
     # Check for #id prefix
-    set rindex 1
     if {[utl_arg_get $rarglist rindex rarg 0]} {
       tj_get_id $rarg rindex uid
     }