Skip to content

Commit fd5bf6a

Browse files
committed
Clean: Rename CLI option to auth instead of credentials.
1 parent be6feb6 commit fd5bf6a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ enum Commands {
8181

8282
/// Define the username:password used to limit access to the server. By default, access is unlimited.
8383
#[arg(short, long, value_parser = parse_credentials)]
84-
credentials: Option<Credentials>,
84+
auth: Option<Credentials>,
8585
},
8686
/// Start the webserver in a child process then exit.
8787
Start {
@@ -100,7 +100,7 @@ enum Commands {
100100
impl Cli {
101101
fn run(self, addr: &SocketAddr) -> Result<(), Box<dyn std::error::Error>> {
102102
match &self.command {
103-
Commands::Serve { log, credentials } => {
103+
Commands::Serve { log, auth: credentials } => {
104104
#[cfg(debug_assertions)]
105105
if let Some(TestMode::Sleep) = self.test_mode {
106106
// For testing, don't start the server at all.
@@ -317,7 +317,7 @@ fn parse_credentials(s: &str) -> Result<Credentials, String> {
317317
let split_: Vec<_> = s.split(":").collect();
318318
if split_.len() != 2 {
319319
Err(format!(
320-
"Unable to parse credentials as username:password; found {} colon-separated string(s)",
320+
"Unable to parse credentials as username:password; found {} colon-separated string(s), but expected 2",
321321
split_.len()
322322
))
323323
} else {

0 commit comments

Comments
 (0)