Skip to content

Commit

Permalink
Merge pull request #47 from TheAlgorythm/USER_DETECT
Browse files Browse the repository at this point in the history
User detect
  • Loading branch information
TheAlgorythm authored Dec 12, 2023
2 parents b97a239 + 86e7a79 commit c921912
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pin-gen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sysexits = "0.7"
argon2 = { version = "0.5", features = ["std"] }
rand_core = { version = "0.6", features = ["std"] }
rpassword = "7.3"
clap = { version = "3.2", features = ["derive"] }
clap = { version = "3.2", features = ["derive", "env"] }
birdcage = { version = "0.3", optional = true }

[features]
Expand Down
11 changes: 8 additions & 3 deletions pin-gen/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
use crate::{Error, Result};
use clap::Parser;
use clap::{Parser, ValueHint};
use error_stack::ResultExt;
use std::path::PathBuf;

#[derive(Parser, Debug, Clone)]
#[clap(author, version, about)]
pub struct CliArgs {
#[clap(short = 'f', long, default_value = "/etc/security/pins.toml")]
#[clap(
short = 'f',
long,
default_value = "/etc/security/pins.toml",
value_hint(ValueHint::FilePath)
)]
pub database_filepath: PathBuf,
#[clap()]
#[clap(env = "SUDO_USER", value_hint(ValueHint::Username))]
pub username: Option<String>,
/// Use this flag to try different parameters.
/// It disables the need for a username and pin.
Expand Down

0 comments on commit c921912

Please sign in to comment.