Don’t show default random password in command-line help

This commit is contained in:
Tobie Morgan Hitchcock 2022-07-19 12:29:43 +01:00
parent 25079918c4
commit a2619a8d72

View file

@ -30,7 +30,7 @@ We would love it if you could star the repository (https://github.com/surrealdb/
"; ";
static PASS: Lazy<String> = Lazy::new(|| { static PASS: Lazy<String> = Lazy::new(|| {
rand::thread_rng().sample_iter(&Alphanumeric).take(128).map(char::from).collect::<String>() rand::thread_rng().sample_iter(&Alphanumeric).take(16).map(char::from).collect::<String>()
}); });
fn file_valid(v: &str) -> Result<(), String> { fn file_valid(v: &str) -> Result<(), String> {
@ -165,6 +165,7 @@ pub fn init() {
Arg::new("pass") Arg::new("pass")
.short('p') .short('p')
.long("pass") .long("pass")
.hide_default_value(true)
.forbid_empty_values(true) .forbid_empty_values(true)
.default_value(PASS.as_str()) .default_value(PASS.as_str())
.help("The master password for the database"), .help("The master password for the database"),