use clap::Parser;
use std::path::PathBuf;
mod style;
use style::get_style;
#[derive(Parser)]
#[command(
version,
about = "Outputs changed=true on first match of the wildcard's on.push.paths. Otherwise outputs changed=false.",
styles = get_style()
)]
pub struct Args {
#[arg(short, long, value_name = "FILE")]
pub wildcard: PathBuf,
#[arg(short, long, value_name = "JSON")]
pub changes: String,
#[arg(short, long)]
pub debug: bool,
}
pub fn parse_args() -> Args {
let mut args = Args::parse();
let prefixed = PathBuf::from(".github/workflows").join(format!("wildcard-{}", args.wildcard.display()));
args.wildcard = prefixed;
args
}