I understand the infix flags work. However, I'm not sure how best to work with argument inputs. I have read the docs as well as looked at some examples from the magit source code but it's still a little bit beyond me as I need some really basic examples to get me started:
Given these two functions:
(defun say-hi:fn (&optional args)
(message "%s" (<read-args> args)))
(define-transient-command say-hi ()
"Say Hi"
["Arguments"
("-g" "Greeting" "--greeting")
("-n" "Name" "--name")]
["Actions"
("H" "Hi" say-hi:fn)])
How do I customise the default Greeting to be
"Hello"
and the default Name to be"World"
?How do I define to sample
<greeting>
and<name>
fromargs
?How do I limit the selection of
<greeting>
to be one ofHello
,Hi
andG'day
?How do I hook up
<name>
to be read from another input source such ascounsel
or a form widget?