]> Cypherpunks repositories - keks.git/commitdiff
Move args functionality to keks.tcl itself
authorSergey Matveev <stargrave@stargrave.org>
Wed, 9 Apr 2025 08:44:13 +0000 (11:44 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 9 Apr 2025 08:44:47 +0000 (11:44 +0300)
tcl/args [deleted file]
tcl/keks.tcl [changed mode: 0644->0755]
tcl/mk-fuzz-inputs

diff --git a/tcl/args b/tcl/args
deleted file mode 100755 (executable)
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]
old mode 100644 (file)
new mode 100755 (executable)
index 2416517..aa15b61
@@ -1,3 +1,4 @@
+#!/usr/bin/env tclsh
 # TclKEKS -- Tcl KEKS encoder implementation
 # Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
 #
@@ -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]
+}
index bfab998aead0bd91b82dc565edc42723682f5a224d0cfed2adea867e30fd2c8c..fb749fe578633a925628eaea0a1501b8ebbf7b194efc1025bfbd62f3b48f00a5 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh -e
 
 dump() {
-    args "$1" | xxd -r -p
+    keks.tcl "$1" | xxd -r -p
 }
 
 dump 'BIN ""' >bin-empty