Skip to content

Commit

Permalink
Fix Feature config
Browse files Browse the repository at this point in the history
  • Loading branch information
ashuio committed Nov 22, 2023
1 parent e3b24c5 commit 222b09b
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions shavee-bin/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,23 +325,14 @@ impl CliArgs {
}
};

// if file feature is enabled, check for file 2FA mode
#[cfg(feature = "file")]
if cmdpresent(&arg, "keyfile") {
if !cfg!(feature = "file") {
return Err(clap::Error::raw(
clap::error::ErrorKind::MissingRequiredArgument,
"File 2FA feature is disabled at compile.",
));
}
#[cfg(feature = "file")]
{
let file = file.expect(shavee_core::UNREACHABLE_CODE);
if file.starts_with(".") {
eprintln!("File PATH must be absolute eg. \"/mnt/a/test.jpg\"");
return Err(clap::Error::new(clap::error::ErrorKind::ValueValidation));
}
second_factor = TwoFactorMode::File { file, port, size };
}
};

Ok(CliArgs {
Expand Down

0 comments on commit 222b09b

Please sign in to comment.