From b37819a6231318dfc9ba94f7b1cde32741acd57826c8e06c05dce14fa634f7e4 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 9 Apr 2025 11:44:13 +0300 Subject: [PATCH] Move args functionality to keks.tcl itself --- tcl/args | 6 ------ tcl/keks.tcl | 8 ++++++++ tcl/mk-fuzz-inputs | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) delete mode 100755 tcl/args mode change 100644 => 100755 tcl/keks.tcl 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 -- 2.50.0