# HG changeset patch # User Matti Hamalainen # Date 1612433754 -7200 # Node ID 76d19fa28753781c0d814f53761ea89d85576065 # Parent 40db544279503fe058e1c58048490d99637549a2 utillib: Add command matching helper function. diff -r 40db54427950 -r 76d19fa28753 utillib.tcl --- a/utillib.tcl Wed Feb 03 13:37:10 2021 +0200 +++ b/utillib.tcl Thu Feb 04 12:15:54 2021 +0200 @@ -128,6 +128,17 @@ } +proc utl_cmd_match { ucommands uid ustr } { + upvar $ucommands ucmds + + if {[info exists ucmds($uid)] && [regexp -nocase -- $ucmds($uid) $ustr]} { + return 1 + } else { + return 0 + } +} + + ### ### SQL database handling ###