diff --git a/command.fnl b/command.fnl index 1c87d88..8a08e46 100644 --- a/command.fnl +++ b/command.fnl @@ -8,9 +8,14 @@ (define-command "quit-browser" #(Gtk.main_quit) {}) -(fn invoke [s] +(fn prompt-missing-args [params explicit-args] + explicit-args) + +(fn invoke [s args] (match (. commands s) - {:function f :params p} (f) + {:function f :params p} + (let [prompted-args (prompt-missing-args p args)] + (f prompted-args)) nil (print "undefined command " s))) diff --git a/frame.fnl b/frame.fnl index 16b0766..8fc3beb 100644 --- a/frame.fnl +++ b/frame.fnl @@ -17,7 +17,7 @@ commander (Gtk.Entry { :on_activate (fn [event] - (command.invoke event.text)) + (command.invoke event.text {})) }) progress-bar (Gtk.ProgressBar { :orientation Gtk.Orientation.HORIZONTAL