|
|
@ -2819,6 +2819,17 @@ namespace eval punk { |
|
|
|
set nscaller [uplevel 1 [list namespace current]] |
|
|
|
set nscaller [uplevel 1 [list namespace current]] |
|
|
|
tailcall interp alias {} $targetcmd {} apply [list args [append cmdcopy " {*}\$args"] $nscaller] |
|
|
|
tailcall interp alias {} $targetcmd {} apply [list args [append cmdcopy " {*}\$args"] $nscaller] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
proc pipealias_extract {targetcmd} { |
|
|
|
|
|
|
|
set applybody [lindex [interp alias "" $targetcmd] 1 1] |
|
|
|
|
|
|
|
#strip off trailing " {*}$args" |
|
|
|
|
|
|
|
return [lrange [string range $applybody 0 end-9] 0 end] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#although the pipealias2 'concat' alias is cleaner in that the original pipeline can be extracted using list commands - it runs much slower |
|
|
|
|
|
|
|
proc pipealias2 {targetcmd args} { |
|
|
|
|
|
|
|
set cmdcopy [punk::objclone $args] |
|
|
|
|
|
|
|
set nscaller [uplevel 1 [list namespace current]] |
|
|
|
|
|
|
|
tailcall interp alias {} $targetcmd {} apply [list args [concat "\[concat" [list $cmdcopy] "\$args]"] $nscaller] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#same as used in unknown func for initial launch |
|
|
|
#same as used in unknown func for initial launch |
|
|
|
#variable re_assign {^([^\r\n=\{]*)=(.*)} |
|
|
|
#variable re_assign {^([^\r\n=\{]*)=(.*)} |
|
|
|