Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename trade subcommand to confirm and deprecate trade subcommand #368

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Lint, Build, Test](https://github.com/dyc3/steamguard-cli/actions/workflows/rust.yml/badge.svg)](https://github.com/dyc3/steamguard-cli/actions/workflows/rust.yml)
[![AUR Tester](https://github.com/dyc3/steamguard-cli/actions/workflows/aur-checker.yml/badge.svg)](https://github.com/dyc3/steamguard-cli/actions/workflows/aur-checker.yml)

A command line utility for setting up and using Steam Mobile Authenticator (AKA Steam 2FA). It can also be used to respond to trade and market confirmations.
A command line utility for setting up and using Steam Mobile Authenticator (AKA Steam 2FA). It can also be used to respond to trade, market, and any other steam mobile confirmations that you would normally get in the app.

**The only legitimate place to download steamguard-cli binaries is through this repo's releases, or by any package manager that is linked in this document.**

Expand Down
7 changes: 4 additions & 3 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::AccountManager;

pub mod code;
pub mod completions;
pub mod confirm;
pub mod debug;
pub mod decrypt;
pub mod encrypt;
Expand All @@ -19,10 +20,10 @@ pub mod qr;
pub mod qr_login;
pub mod remove;
pub mod setup;
pub mod trade;

pub use code::CodeCommand;
pub use completions::CompletionsCommand;
pub use confirm::ConfirmCommand;
pub use debug::DebugCommand;
pub use decrypt::DecryptCommand;
pub use encrypt::EncryptCommand;
Expand All @@ -32,7 +33,6 @@ pub use qr::QrCommand;
pub use qr_login::QrLoginCommand;
pub use remove::RemoveCommand;
pub use setup::SetupCommand;
pub use trade::TradeCommand;

/// A command that does not operate on the manifest or individual accounts.
pub(crate) trait ConstCommand {
Expand Down Expand Up @@ -166,7 +166,8 @@ pub(crate) enum Subcommands {
Completion(CompletionsCommand),
Setup(SetupCommand),
Import(ImportCommand),
Trade(TradeCommand),
#[clap(alias = "trade")]
Confirm(ConfirmCommand),
Remove(RemoveCommand),
Encrypt(EncryptCommand),
Decrypt(DecryptCommand),
Expand Down
14 changes: 7 additions & 7 deletions src/commands/trade.rs → src/commands/confirm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ use crate::{tui, AccountManager};
use super::*;

#[derive(Debug, Clone, Parser)]
#[clap(about = "Interactive interface for trade confirmations")]
pub struct TradeCommand {
#[clap(about = "Interactive interface for steam mobile confirmations")]
pub struct ConfirmCommand {
#[clap(
short,
long,
help = "Accept all open trade confirmations. Does not open interactive interface."
help = "Accept all open mobile confirmations. Does not open interactive interface."
)]
pub accept_all: bool,
#[clap(
Expand All @@ -25,7 +25,7 @@ pub struct TradeCommand {
pub fail_fast: bool,
}

impl<T> AccountCommand<T> for TradeCommand
impl<T> AccountCommand<T> for ConfirmCommand
where
T: Transport + Clone,
{
Expand All @@ -44,12 +44,12 @@ where
crate::do_login(transport.clone(), &mut account, args.password.clone())?;
}

info!("{}: Checking for trade confirmations", account.account_name);
info!("{}: Checking for confirmations", account.account_name);
let confirmations: Vec<Confirmation>;
loop {
let confirmer = Confirmer::new(transport.clone(), &account);

match confirmer.get_trade_confirmations() {
match confirmer.get_confirmations() {
Ok(confs) => {
confirmations = confs;
break;
Expand All @@ -59,7 +59,7 @@ where
crate::do_login(transport.clone(), &mut account, args.password.clone())?;
}
Err(err) => {
error!("Failed to get trade confirmations: {}", err);
error!("Failed to get confirmations: {}", err);
return Err(err.into());
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ fn run(args: commands::Args) -> anyhow::Result<()> {
Subcommands::Import(args) => CommandType::Manifest(Box::new(args)),
Subcommands::Encrypt(args) => CommandType::Manifest(Box::new(args)),
Subcommands::Decrypt(args) => CommandType::Manifest(Box::new(args)),
Subcommands::Trade(args) => CommandType::Account(Box::new(args)),
Subcommands::Confirm(args) => CommandType::Account(Box::new(args)),
Subcommands::Remove(args) => CommandType::Account(Box::new(args)),
Subcommands::Code(args) => CommandType::Account(Box::new(args)),
#[cfg(feature = "qr")]
Expand Down
2 changes: 1 addition & 1 deletion steamguard/src/confirmation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ where
cookies
}

pub fn get_trade_confirmations(&self) -> Result<Vec<Confirmation>, ConfirmerError> {
pub fn get_confirmations(&self) -> Result<Vec<Confirmation>, ConfirmerError> {
let cookies = self.build_cookie_jar();
let client = self.transport.innner_http_client()?;

Expand Down
Loading