Index: openacs-4/packages/acs-tcl/tcl/00-icanuse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/00-icanuse-procs.tcl,v diff -u -N -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/acs-tcl/tcl/00-icanuse-procs.tcl 25 May 2020 10:21:08 -0000 1.1.2.8 +++ openacs-4/packages/acs-tcl/tcl/00-icanuse-procs.tcl 6 Jun 2020 09:47:48 -0000 1.1.2.9 @@ -53,6 +53,18 @@ catch [list $cmd ""] errorMsg return [expr {" $subcommand" in [split $errorMsg ","]}] } + + ad_proc -private cmd_error_contains {cmd subcommand} { + + Helper proc abusing error messages to determine, whether the + error message contains some string. This is a weeker form of + cmd_has_subcommand. + + } { + catch $cmd errorMsg + return [string match *$subcommand* $errorMsg] + } + } @@ -72,6 +84,7 @@ ::acs::register_icanuse "ns_conn partialtimes" [acs::cmd_has_subcommand ns_conn partialtimes] ::acs::register_icanuse "ns_conn contentsentlength" [acs::cmd_has_subcommand ns_conn contentsentlength] +::acs::register_icanuse "nsv_dict" [acs::cmd_error_contains {nsv_dict get ""} -varname] ::acs::register_icanuse "ns_crypto::randombytes" {[info commands ::ns_crypto::randombytes] ne ""}