diff options
Diffstat (limited to 'src/cli.rs')
-rw-r--r-- | src/cli.rs | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -3,7 +3,7 @@ use clap::{Subcommand, Parser, ValueHint}; use std::env; #[derive(Debug, Parser)] -#[command(version, about, long_about = None)] +#[command(version, about = "A simple debt manager", long_about = None)] pub struct Cli { /// file path where data is stored [default: /// $XDG_DATA_HOME/debt/debt.db @@ -24,7 +24,7 @@ pub enum Commands { person: String, /// amount of money - amount: i32, + amount: u32, /// additional notes note: Option<String>, @@ -34,13 +34,15 @@ pub enum Commands { payment: bool }, + /// View Registered data View { + /// Filter history data (only works with -H) filter: Option<String>, /// View register history - #[arg(short='H', long)] + #[arg(short='H', long, conflicts_with = "total")] history: bool, /// Transaction accumulation by person - #[arg(short, long)] + #[arg(short, long, conflicts_with = "history")] total: bool }, @@ -70,7 +72,7 @@ fn load_datapath(cli: &mut Cli) { }) }).or_else(|| { if let Ok(home) = env::var("HOME") { - let fallback = PathBuf::from(&home).join(".debt.db"); + let fallback = PathBuf::from(&home).join(".cache.db"); if fallback.exists() { return Some(fallback) } |