This should fix the autoload issues with transient

This commit is contained in:
Lucien Cartier-Tilet 2022-03-02 18:34:27 +01:00
parent 4b8fcc95c0
commit c33f99c2ef
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
1 changed files with 24 additions and 11 deletions

View File

@ -319,7 +319,9 @@ This function is meant to be called by a transient.")
(bitwarden--set-config-server)]
["Actions"
("g" "Get current server" bitwarden--action-get-server)
("s" "Set current server" bitwarden--action-set-server)])
("s" "Set current server" bitwarden--action-set-server)]
(interactive)
(transient-setup 'bitwarden-config))
(transient-define-prefix bitwarden-login ()
["Options"
@ -331,30 +333,41 @@ This function is meant to be called by a transient.")
(bitwarden--set-login-code)]
["Actions"
("l" "Login" bitwarden--action-login)
("L" "Logout" bitwarden--action-logout)])
("L" "Logout" bitwarden--action-logout)]
(interactive)
(transient-setup 'bitwarden-login))
(transient-define-prefix bitwarden-transient ()
["Actions"
("c" "Config" bitwarden--config)
("l" "Login" bitwarden--login)
("c" "Config" bitwarden-config)
("l" "Login" bitwarden-login)
("L" "Lock" bitwarden-lock)
("s" "sync" bitwarden-dummy)])
("s" "sync" bitwarden-dummy)]
(interactive)
(transient-setup 'bitwarden-transient))
;;; Public functions
;;;###autoload
(defun bitwarden-lock ()
"Lock the vault and destroy active session keys."
"Lock the vault and destroy active session keys.
The command may fail in the user is not logged in."
(interactive)
(progn
(setq bitwarden--session nil
bitwarden--login-password nil
bitwarden--login-passwordenv nil
bitwarden--login-passwordfile nil
bitwarden--login-code nil)
(bitwarden--run-cli "lock")))
(bitwarden--run-cli "lock")
(if (= 0 bitwarden--shell-status)
(message "Bitwarden: successfuly locked")
(message "Bitwarden: something went wrong"))))
;; (defun bitwarden ()
;; (interactive)
;; (call-interactively #'bitwarden-transient))
;;;###autoload
(defun bitwarden ()
"Call the main transient for Bitwarden."
(interactive)
(call-interactively #'bitwarden-transient))
(provide 'bitwarden)