From e5eea4ab99897de52c84c5f2fbdcb49bb90169ab Mon Sep 17 00:00:00 2001 From: Aleteoryx Date: Mon, 20 Oct 2025 16:05:21 -0400 Subject: [PATCH] do command parsing the non-lazy way --- ntalk.tcl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ntalk.tcl b/ntalk.tcl index 2a3bdc5aec2abbea1b62046cd8f0e2684d0bb9ac..3ee3796183fe4092e7b9b958a64d53e134fc6625 100755 --- a/ntalk.tcl +++ b/ntalk.tcl @@ -319,7 +319,7 @@ menu .menu.server.rm -tearoff 0 .menu.nt add command -label "about ntalk" -command { tk_messageBox -title "about ntalk" \ -message "ntalk\nby aleteoryx" \ - -detail "last updated 2025-10-18" \ + -detail "last updated 2025-10-20" \ -icon "info" } .menu.nt add separator @@ -985,7 +985,14 @@ bind .foot.input [concat [bind .foot.input ] ";" { return } - set line [lassign [string range $line 1 end] cmd] + set idx [string first " " $line] + if {$idx == -1} { + set idx end + } else { + incr idx -1 + } + set cmd [string range $line 1 $idx] + set line [string range $line $idx+2 end] switch -nocase -- $cmd [concat $cmds { hist { hist } quit { quit }