From: Sergey Matveev Date: Wed, 9 Apr 2025 08:44:13 +0000 (+0300) Subject: Move args functionality to keks.tcl itself X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b37819a6231318dfc9ba94f7b1cde32741acd57826c8e06c05dce14fa634f7e4;p=keks.git Move args functionality to keks.tcl itself --- diff --git a/tcl/args b/tcl/args deleted file mode 100755 index 816ca38..0000000 --- a/tcl/args +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env tclsh - -source [file join [file dirname $::argv0] keks.tcl] -namespace import KEKS::* -eval [lindex $::argv 0] -puts [binary encode hex $::KEKS::buf] diff --git a/tcl/keks.tcl b/tcl/keks.tcl old mode 100644 new mode 100755 index 2416517..aa15b61 --- a/tcl/keks.tcl +++ b/tcl/keks.tcl @@ -1,3 +1,4 @@ +#!/usr/bin/env tclsh # TclKEKS -- Tcl KEKS encoder implementation # Copyright (C) 2024-2025 Sergey Matveev # @@ -299,3 +300,10 @@ namespace export TAI64 UTCFromISO namespace export LIST MAP SET LenFirstSort BLOB } + +if {[info exists argv0] && ([file tail [info script]] eq [file tail $argv0])} { + namespace import KEKS::* + set buf "" + eval [lindex $::argv 0] + puts [binary encode hex $buf] +} diff --git a/tcl/mk-fuzz-inputs b/tcl/mk-fuzz-inputs index bfab998..fb749fe 100755 --- a/tcl/mk-fuzz-inputs +++ b/tcl/mk-fuzz-inputs @@ -1,7 +1,7 @@ #!/bin/sh -e dump() { - args "$1" | xxd -r -p + keks.tcl "$1" | xxd -r -p } dump 'BIN ""' >bin-empty