swtich mafiles path to new args

This commit is contained in:
Carson McManus 2022-06-19 11:26:18 -04:00
parent 07b9439c27
commit b040088038
2 changed files with 5 additions and 5 deletions

View file

@ -9,8 +9,8 @@ pub(crate) struct Args {
#[clap(short, long, help = "Select all accounts in the manifest.")] #[clap(short, long, help = "Select all accounts in the manifest.")]
pub all: bool, pub all: bool,
/// The path to the maFiles directory. /// The path to the maFiles directory.
#[clap(short, long, default_value = "~/.config/steamguard-cli/maFiles", help = "Specify which folder your maFiles are in. This should be a path to a folder that contains manifest.json.")] #[clap(short, long, help = "Specify which folder your maFiles are in. This should be a path to a folder that contains manifest.json. Default: ~/.config/steamguard-cli/maFiles")]
pub mafiles_path: String, pub mafiles_path: Option<String>,
#[clap(short, long, help = "Specify your encryption passkey.")] #[clap(short, long, help = "Specify your encryption passkey.")]
pub passkey: Option<String>, pub passkey: Option<String>,
#[clap(short, long, default_value_t=Verbosity::Info, help = "Set the log level.")] #[clap(short, long, default_value_t=Verbosity::Info, help = "Set the log level.")]

View file

@ -174,8 +174,8 @@ fn run() -> anyhow::Result<()> {
_ => {}, _ => {},
}; };
let mafiles_dir = if matches.occurrences_of("mafiles-path") > 0 { let mafiles_dir = if let Some(mafiles_path) = new_args.mafiles_path {
matches.value_of("mafiles-path").unwrap().into() mafiles_path
} else { } else {
get_mafiles_dir() get_mafiles_dir()
}; };
@ -202,7 +202,7 @@ fn run() -> anyhow::Result<()> {
manifest = accountmanager::Manifest::load(path.as_path())?; manifest = accountmanager::Manifest::load(path.as_path())?;
} }
let mut passkey: Option<String> = matches.value_of("passkey").map(|s| s.into()); let mut passkey: Option<String> = new_args.passkey;
manifest.submit_passkey(passkey); manifest.submit_passkey(passkey);
loop { loop {