("d" "deployment" kubed-transient-create-deployment)
("n" "namespace" kubed-create-namespace)]
["Actions"
- ("c" "Create" kubed-create)])
+ ("c" "Create" kubed-create)
+ ("!" "Command line" kubed-kubectl-command)]
+ (interactive)
+ (transient-setup 'kubed-transient-create nil nil
+ :scope '("create")))
;;;###autoload
(transient-define-prefix kubed-transient-create-deployment ()
("--" "Command" "-- ="
:prompt "Command: ")]
["Actions"
- ("c" "Create" kubed-create)])
+ ("c" "Create" kubed-create)
+ ("!" "Command line" kubed-kubectl-command)]
+ (interactive)
+ (transient-setup 'kubed-transient-create-deployment nil nil
+ :scope '("create" "deployment")))
(provide 'kubed-transient)
;;; kubed-transient.el ends here
(defvar kubed-kubectl-command-history nil
"Minibuffer history for `kubed-kubectl-command'.")
+(defvar transient-current-command)
+
;;;###autoload
(defun kubed-kubectl-command (command)
"Execute `kubectl' COMMAND.
Interactively, prompt for COMMAND with completion for `kubectl' arguments."
(interactive
- (list (cobra-read-command-line "Command: " "kubectl "
- 'kubed-kubectl-command-history)))
+ (list (cobra-read-command-line
+ "Command: "
+ (concat
+ kubed-kubectl-program " "
+ (when-let
+ ((args
+ (and (fboundp 'transient-args)
+ (fboundp 'transient-scope)
+ transient-current-command
+ (string-join
+ (append (transient-scope)
+ (transient-args transient-current-command))
+ " "))))
+ (concat args " ")))
+ 'kubed-kubectl-command-history)))
(shell-command command))
;;;###autoload (autoload 'kubed-prefix-map "kubed" nil t 'keymap)