cyto_cli/
output.rs

1use std::path::PathBuf;
2
3use anyhow::Result;
4use clap::Parser;
5use cyto_io::validate_output_directory;
6
7#[derive(Parser, Debug)]
8#[clap(next_help_heading = "Output Options")]
9pub struct ArgsOutput {
10    /// Output directory path
11    #[clap(short = 'o', long, default_value = "./cyto_out")]
12    pub outdir: String,
13    #[clap(short = 'H', long)]
14    pub with_header: bool,
15    /// Force overwrite of existing output directory
16    #[clap(short = 'f', long)]
17    pub force: bool,
18}
19impl ArgsOutput {
20    pub fn validate_outdir(&self) -> Result<()> {
21        validate_output_directory(&self.outdir, self.force)
22    }
23    pub fn log_path(&self) -> PathBuf {
24        PathBuf::from(&self.outdir).join("cyto.log")
25    }
26}