# HG changeset patch # User Matti Hamalainen # Date 1613835889 -7200 # Node ID 586caf75fccc652f49ae177777c86b4e35c651c0 # Parent 8bde8f798188bc0654aaa619fb72e7eb98890827 utillib: Add utl_arg_rest helper. diff -r 8bde8f798188 -r 586caf75fccc utillib.tcl --- a/utillib.tcl Sat Feb 20 17:35:40 2021 +0200 +++ b/utillib.tcl Sat Feb 20 17:44:49 2021 +0200 @@ -146,6 +146,19 @@ } +proc utl_arg_rest {uarglist uindex ustr} { + upvar $ustr dstr + + if {$uindex < [llength $uarglist]} { + set dstr [join [lrange $uarglist $uindex end] " "] + return 1 + } else { + set dstr "" + return 0 + } +} + + ### ### HTML / HTTP related ###