remove username argument from ArgsSetup because it was causing problems

This commit is contained in:
Carson McManus 2022-12-05 09:18:38 -05:00
parent db6557ca0d
commit 85c4662a61
2 changed files with 3 additions and 12 deletions

View file

@ -116,10 +116,7 @@ pub(crate) struct ArgsCompletions {
#[derive(Debug, Clone, Parser)]
#[clap(about = "Set up a new account with steamguard-cli")]
pub(crate) struct ArgsSetup {
#[clap(short, long, from_global, help = "Steam username, case-sensitive.")]
pub username: Option<String>,
}
pub(crate) struct ArgsSetup {}
#[derive(Debug, Clone, Parser)]
#[clap(about = "Import an account with steamguard already set up")]

View file

@ -349,18 +349,12 @@ fn do_subcmd_completion(args: cli::ArgsCompletions) -> Result<(), anyhow::Error>
}
fn do_subcmd_setup(
args: cli::ArgsSetup,
_args: cli::ArgsSetup,
manifest: &mut accountmanager::Manifest,
) -> anyhow::Result<()> {
println!("Log in to the account that you want to link to steamguard-cli");
print!("Username: ");
let username = if args.username.is_some() {
let u = args.username.unwrap();
println!("{}", u);
u
} else {
tui::prompt()
};
let username = tui::prompt();
let account_name = username.clone();
if manifest.account_exists(&username) {
bail!(