From 9916456972a96fb8f5173db6349b5521daf307ab Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Fri, 18 Aug 2023 07:55:46 +0200 Subject: [PATCH] Fix default argument handling --- justl.el | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/justl.el b/justl.el index 76699a1..8da730c 100644 --- a/justl.el +++ b/justl.el @@ -388,11 +388,6 @@ They are returned as objects, as per the JSON output of \"just --dump\"." "Get the default value of argument ARG." (let-alist arg .default)) -(defun justl--arg-default-as-string (arg) - "Get the default value of argument ARG as a string. -Empty string is returned if the arg has no default." - (if arg (format "%s" arg) "")) - (defun justl--justfile-argument () "Provides justfile argument with the proper location." (format "--justfile=%s" (tramp-file-local-name justl-justfile))) @@ -418,7 +413,7 @@ Empty string is returned if the arg has no default." (cons recipe-name (mapcar (lambda (arg) (read-from-minibuffer (format "Just arg for %s: " (justl--arg-name arg)) - (justl--arg-default-as-string arg))) + (justl--arg-default arg))) (justl--recipe-args recipe))))))) (defun justl-exec-default-recipe () @@ -469,7 +464,7 @@ not executed." justl-executable (cons (justl--recipe-name recipe) (append (transient-args 'justl-help-popup) - (mapcar 'justl--arg-default-as-string + (mapcar 'justl--arg-default (justl--recipe-args recipe))))) " ")) (unless no-send @@ -522,7 +517,7 @@ not executed." (cons (justl--recipe-name recipe) (mapcar (lambda (arg) (read-from-minibuffer (format "Just arg for `%s': " (justl--arg-name arg)) - (justl--arg-default-as-string arg))) + (justl--arg-default arg))) (justl--recipe-args recipe))))))) (defun justl--exec-recipe-with-args ()