# HG changeset patch # User Matti Hamalainen # Date 1614085844 -7200 # Node ID 57dd82ac2a06a5e347712c57b69e03d33d80025f # Parent afe4b1fe5e799a5343d7e27b9df599e1ddbcb550 quotedb: Rename some variables. diff -r afe4b1fe5e79 -r 57dd82ac2a06 quotedb.tcl --- a/quotedb.tcl Tue Feb 23 15:09:51 2021 +0200 +++ b/quotedb.tcl Tue Feb 23 15:10:44 2021 +0200 @@ -439,7 +439,7 @@ #------------------------------------------------------------------------- -proc qdb_cmd {ucmd utable unick uhost uhand uchan utext upublic} { +proc qdb_cmd {ucmd utable unick uhost uhand uchan uargs upublic} { global qdb_channels # Check if command comes from allowed channel or is private @@ -448,38 +448,38 @@ } # Trim argument text - set utext [string trim $utext] + set uargs [string trim $uargs] - if {$utext == "" || $utext == {}} { + if {$uargs == "" || $uargs == {}} { # No arguments, assume random query qdb_show $ucmd $utable $upublic $unick $uhost $uhand $uchan -1 - } elseif {[regexp {^(stat|stats|tilasto|tilastot)$} $utext]} { + } elseif {[regexp {^(stat|stats|tilasto|tilastot)$} $uargs]} { # Statistics - qdb_stats $ucmd $utable $upublic $unick $uhost $uhand $uchan $utext - } elseif {[regexp {^(last|latest|uusin|viimeisin)$} $utext]} { + qdb_stats $ucmd $utable $upublic $unick $uhost $uhand $uchan $uargs + } elseif {[regexp {^(last|latest|uusin|viimeisin)$} $uargs]} { # Latest added qdb_show $ucmd $utable $upublic $unick $uhost $uhand $uchan -2 - } elseif {[regexp {^([0-9]+)$} $utext -> unum]} { + } elseif {[regexp {^([0-9]+)$} $uargs -> unum]} { # Numeric argument, assume id query qdb_show $ucmd $utable $upublic $unick $uhost $uhand $uchan $unum - } elseif {[regexp {^top\s*([0-9]+)?$} $utext -> uargs]} { + } elseif {[regexp {^top\s*([0-9]+)?$} $uargs -> rargs]} { # Toplist of quotes - qdb_toplist $ucmd $utable $upublic $unick $uhost $uhand $uchan $utext $uargs - } elseif {[regexp {^add\s*(.*)$} $utext -> uargs]} { + qdb_toplist $ucmd $utable $upublic $unick $uhost $uhand $uchan $uargs $rargs + } elseif {[regexp {^add\s*(.*)$} $uargs -> rargs]} { # Add quote - qdb_add $ucmd $utable $upublic $unick $uhost $uhand $uchan $uargs - } elseif {[regexp {^del\s*([0-9]*)$} $utext -> uargs]} { + qdb_add $ucmd $utable $upublic $unick $uhost $uhand $uchan $rargs + } elseif {[regexp {^del\s*([0-9]*)$} $uargs -> rargs]} { # Delete quote - qdb_delete $ucmd $utable $upublic $unick $uhost $uhand $uchan $uargs - } elseif {[regexp {^update\s*(.*)$} $utext -> uargs]} { + qdb_delete $ucmd $utable $upublic $unick $uhost $uhand $uchan $rargs + } elseif {[regexp {^update\s*(.*)$} $uargs -> rargs]} { # Modify/update quote - qdb_update $ucmd $utable $upublic $unick $uhost $uhand $uchan $uargs - } elseif {[regexp {^find\s*(.*)$} $utext -> uargs]} { + qdb_update $ucmd $utable $upublic $unick $uhost $uhand $uchan $rargs + } elseif {[regexp {^find\s*(.*)$} $uargs -> rargs]} { # Find quote(s) - qdb_find $ucmd $utable $upublic $unick $uhost $uhand $uchan $uargs - } elseif {[regexp {^vote\s*(.*)$} $utext -> uargs]} { + qdb_find $ucmd $utable $upublic $unick $uhost $uhand $uchan $rargs + } elseif {[regexp {^vote\s*(.*)$} $uargs -> rargs]} { # Vote - qdb_vote $ucmd $utable $upublic $unick $uhost $uhand $uchan $uargs + qdb_vote $ucmd $utable $upublic $unick $uhost $uhand $uchan $rargs } else { # Help/usage qdb_msg $ucmd $utable $upublic $unick $uchan "help"