Skip to content

Commit 9236ae5

Browse files
authored
rename text_or_env_prompt to resolve_user_input_value
1 parent 398c69d commit 9236ae5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

crates/bitwarden-cli/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn text_prompt_when_none(prompt: &str, val: Option<String>) -> InquireResult
1919
/// Try to get a value from CLI arg, then from environment variables, then prompt
2020
///
2121
/// Checks multiple environment variable names in order (e.g., BW_CLIENTID, BW_CLIENT_ID)
22-
pub fn text_or_env_prompt(
22+
pub fn resolve_user_input_value(
2323
prompt: &str,
2424
cli_val: Option<String>,
2525
env_var_names: &[&str],

crates/bw/src/auth/login.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use bitwarden_cli::{text_or_env_prompt, text_prompt_when_none};
1+
use bitwarden_cli::{resolve_user_input_value, text_prompt_when_none};
22
use bitwarden_core::{
33
Client,
44
auth::login::{
@@ -94,8 +94,8 @@ pub(crate) async fn login_api_key(
9494
client_id: Option<String>,
9595
client_secret: Option<String>,
9696
) -> Result<String> {
97-
let client_id = text_or_env_prompt("Client ID", client_id, &["BW_CLIENTID", "BW_CLIENT_ID"])?;
98-
let client_secret = text_or_env_prompt(
97+
let client_id = resolve_user_input_value("Client ID", client_id, &["BW_CLIENTID", "BW_CLIENT_ID"])?;
98+
let client_secret = resolve_user_input_value(
9999
"Client Secret",
100100
client_secret,
101101
&["BW_CLIENTSECRET", "BW_CLIENT_SECRET"],

0 commit comments

Comments
 (0)