Commit 980079e

mo khan <mo@mokhan.ca>
2026-01-22 02:25:05
refactor: change state of tool header
1 parent f47b5b1
Changed files (2)
lib
lib/elelem/plugins/execute.rb
@@ -11,7 +11,7 @@ Elelem::Plugins.register(:execute) do |toolbox|
   end
 
   toolbox.after("execute") do |args, result|
-    status = result[:exit_status] == 0 ? "ok" : "FAIL"
-    $stdout.puts "  #{status} #{args["command"]}"
+    status = result[:exit_status] == 0 ? "✓" : "x"
+    $stdout.puts toolbox.header("execute", args, state: status)
   end
 end
lib/elelem/toolbox.rb
@@ -24,9 +24,9 @@ module Elelem
       @hooks[:after][tool_name] << block
     end
 
-    def header(name, args)
+    def header(name, args, state: "+")
       name = tool_for(name)&.name || "#{name}?"
-      "\n+ #{name}(#{args})"
+      "\n#{state} #{name}(#{args})"
     end
 
     def run(name, args)