Change cal --week-start examples + error message (#12597)

This PR fixes the example for `cal --week-start` and adds the list of
expected values to the error message.
This commit is contained in:
woosaaahh 2024-04-20 22:39:46 +02:00 committed by GitHub
parent cf8fcef9bf
commit 5e52bd77e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,7 +77,7 @@ impl Command for Cal {
},
Example {
description: "This month's calendar with the week starting on monday",
example: "cal --week-start monday",
example: "cal --week-start mo",
result: None,
},
]
@ -269,7 +269,7 @@ fn add_month_to_table(
week_start_day = s.to_string();
} else {
return Err(ShellError::TypeMismatch {
err_message: "The specified week start day is invalid".to_string(),
err_message: "The specified week start day is invalid, expected one of ['su', 'mo', 'tu', 'we', 'th', 'fr', 'sa']".to_string(),
span: day.span,
});
}