TransactionCommands

Enum TransactionCommands 

Source
pub enum TransactionCommands {
    Add {
        account: String,
        amount: String,
        payee: Option<String>,
        category: Option<String>,
        date: Option<String>,
        memo: Option<String>,
        cleared: bool,
        auto_categorize: bool,
    },
    List {
        account: Option<String>,
        category: Option<String>,
        limit: usize,
        from: Option<String>,
        to: Option<String>,
        status: Option<String>,
    },
    Show {
        id: String,
    },
    Edit {
        id: String,
        amount: Option<String>,
        payee: Option<String>,
        category: Option<String>,
        date: Option<String>,
        memo: Option<String>,
    },
    Delete {
        id: String,
        force: bool,
    },
    Clear {
        id: String,
    },
    Unclear {
        id: String,
    },
    Unlock {
        id: String,
    },
}
Expand description

Transaction subcommands

Variants§

§

Add

Add a new transaction

Fields

§account: String

Account name or ID

§amount: String

Amount (e.g., “-50.00” for outflow, “100.00” for inflow)

§payee: Option<String>

Payee name

§category: Option<String>

Category name

§date: Option<String>

Transaction date (YYYY-MM-DD), defaults to today

§memo: Option<String>

Memo

§cleared: bool

Mark as cleared

§auto_categorize: bool

Auto-categorize based on payee history

§

List

List transactions

Fields

§account: Option<String>

Filter by account name or ID

§category: Option<String>

Filter by category name

§limit: usize

Number of transactions to show

§from: Option<String>

Start date (YYYY-MM-DD)

§to: Option<String>

End date (YYYY-MM-DD)

§status: Option<String>

Filter by status (pending, cleared, reconciled)

§

Show

Show transaction details

Fields

§id: String

Transaction ID

§

Edit

Edit a transaction

Fields

§id: String

Transaction ID

§amount: Option<String>

New amount

§payee: Option<String>

New payee

§category: Option<String>

New category

§date: Option<String>

New date

§memo: Option<String>

New memo

§

Delete

Delete a transaction

Fields

§id: String

Transaction ID

§force: bool

Skip confirmation

§

Clear

Clear a transaction (mark as cleared)

Fields

§id: String

Transaction ID

§

Unclear

Unclear a transaction (mark as pending)

Fields

§id: String

Transaction ID

§

Unlock

Unlock a reconciled transaction for editing

Fields

§id: String

Transaction ID

Trait Implementations§

Source§

impl FromArgMatches for TransactionCommands

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for TransactionCommands

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.