use clap::{Parser, Subcommand};
#[derive(Debug, Parser)]
#[clap(author, version, about, long_about = None)]
pub struct Args {
#[clap(subcommand)]
pub operation: Operation,
}
#[derive(Debug, Subcommand)]
pub enum Operation {
Add { operands: Vec<f64> },
Sub { operands: Vec<f64> },
Mul { operands: Vec<f64> },
Div { operands: Vec<f64> },
Mod { a: f64, b: f64 },
Quot { a: f64, b: f64 },
Pow { base: f64, exponent: i64 },
Sqrt {
n: f64,
#[clap(short, long = "iterations", default_value_t = 10)]
iters: u32,
},
Fact { n: u64 },
Quadratic { a: f64, b: f64, c: f64 },
Sin { x: f64 },
Cos { x: f64 },
Tan { x: f64 },
Eval { equation: String },
}