Update clap version and cli build
This commit is contained in:
31
src/main.rs
31
src/main.rs
@@ -3,33 +3,33 @@ use std::path::PathBuf;
|
||||
use clap::{Parser, Subcommand};
|
||||
|
||||
#[derive(Parser)]
|
||||
#[clap(name = "coster-rs")]
|
||||
#[clap(author = "Pivato M. <mpivato4@gmail.com>")]
|
||||
#[clap(version = "0.0.1")]
|
||||
#[clap(about = "Simple, fast, efficient costing tool", long_about = None)]
|
||||
#[command(name = "coster-rs", author = "Pivato M. <mpivato4@gmail.com>", version = "0.0.1", about = "Simple, fast, efficient costing tool", long_about = None)]
|
||||
struct Cli {
|
||||
#[clap(subcommand)]
|
||||
#[command(subcommand)]
|
||||
command: Commands,
|
||||
}
|
||||
|
||||
#[derive(Subcommand)]
|
||||
enum Commands {
|
||||
move_money {
|
||||
#[clap(short = 'r', long, parse(from_os_str), value_name = "FILE")]
|
||||
#[arg(short = 'r', long, value_name = "FILE")]
|
||||
rules: PathBuf,
|
||||
|
||||
#[clap(short, long, parse(from_os_str), value_name = "FILE")]
|
||||
output: Option<PathBuf>,
|
||||
#[arg(short, long, value_name = "FILE")]
|
||||
data: PathBuf,
|
||||
|
||||
#[arg(short, long, value_name = "FILE", default_value = "./output.csv")]
|
||||
output: PathBuf,
|
||||
},
|
||||
allocate_overheads {
|
||||
#[clap(short, long, parse(from_os_str), value_name = "FILE")]
|
||||
#[arg(short, long, value_name = "FILE")]
|
||||
rules: PathBuf,
|
||||
|
||||
#[clap(short, long, parse(from_os_str), value_name = "FILE")]
|
||||
#[arg(short, long, value_name = "FILE")]
|
||||
lines: PathBuf,
|
||||
|
||||
#[clap(short, long, parse(from_os_str), value_name = "FILE")]
|
||||
output: Option<PathBuf>,
|
||||
#[arg(short, long, value_name = "FILE", default_value = "./output.csv")]
|
||||
output: PathBuf,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ fn main() {
|
||||
let cli = Cli::parse();
|
||||
|
||||
match cli.command {
|
||||
Commands::move_money { rules, output } => move_money(),
|
||||
Commands::move_money { rules, data, output } => move_money(rules, data, output),
|
||||
Commands::allocate_overheads {
|
||||
rules,
|
||||
lines,
|
||||
@@ -47,8 +47,9 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
fn move_money() {
|
||||
// read rules, for each rule, inspect the files and
|
||||
fn move_money(rules: PathBuf, data: PathBuf, output: PathBuf) {
|
||||
// Read all rules/data into memory (can figure out an alternative way later)
|
||||
|
||||
}
|
||||
|
||||
fn allocate_overheads() {}
|
||||
|
||||
Reference in New Issue
Block a user