This commit is contained in:
Audrey 2024-04-15 12:17:50 -07:00
parent 61caed9ccd
commit 9c3349178e
1 changed files with 9 additions and 1 deletions

View File

@ -13,8 +13,16 @@ struct Cli {
#[derive(Subcommand, Debug, Clone)]
enum Subcommands {
Run {
/// Any number of filepaths to treat as inputs. They will be hashed and accesses to
/// equivalent files will be treated specially.
#[arg(short, long)]
input: Vec<PathBuf>,
/// The filepath to dump the json report to. will dump to stdout if unspecified.
#[arg(short, long)]
output: Option<PathBuf>,
/// The command to run. Have fun!
cmd: Vec<String>,
}
}
@ -23,7 +31,7 @@ fn main() {
env_logger::init();
let cli = Cli::parse();
match cli.cmd {
Subcommands::Run { output, cmd } => {
Subcommands::Run { input, output, cmd } => {
let fp: Box<dyn std::io::Write> = if let Some(output) = &output {
Box::new(std::fs::File::options().write(true).create(true).open(output).unwrap())
} else {