Simplify setting server
This commit is contained in:
parent
dd1a740350
commit
3e2d16ad64
21
bitwarden.el
21
bitwarden.el
@ -164,7 +164,9 @@ This macro is largely copied from Tecosaur’s screenshot.el"
|
||||
(if (eq 0 bitwarden--shell-status)
|
||||
(string-trim output-str "https?://")
|
||||
""))
|
||||
(read-string "Server URL: "))
|
||||
(let ((server (read-string "Server URL: ")))
|
||||
(bitwarden--run-cli "config" "server" server)
|
||||
server))
|
||||
|
||||
;; Login
|
||||
|
||||
@ -273,21 +275,13 @@ This function is meant to be called by a transient.")
|
||||
,@body))
|
||||
|
||||
;; Config
|
||||
|
||||
(bitwarden--def-action
|
||||
"set-server"
|
||||
"Set the Bitwarden server."
|
||||
"config-quit"
|
||||
"Exit Bitwarden config."
|
||||
'bitwarden-config
|
||||
(bitwarden--run-cli "config" "server" bitwarden--config-server))
|
||||
|
||||
(bitwarden--def-action
|
||||
"get-server"
|
||||
"Get the URL of the on-premises hosted installation."
|
||||
'bitwarden-config
|
||||
(bitwarden--run-cli "config" "server"))
|
||||
#'nil)
|
||||
|
||||
;; Login
|
||||
|
||||
(bitwarden--def-action
|
||||
"login"
|
||||
"Log in Bitwarden."
|
||||
@ -310,8 +304,7 @@ This function is meant to be called by a transient.")
|
||||
["Options"
|
||||
(bitwarden--set-config-server)]
|
||||
["Actions"
|
||||
("g" "Get current server" bitwarden--action-get-server)
|
||||
("s" "Set current server" bitwarden--action-set-server)]
|
||||
("q" "Quit" bitwarden--action-config-quit)]
|
||||
(interactive)
|
||||
(transient-setup 'bitwarden-config))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user