smart-patcher 0.7.0

Patcher based on rules
Documentation
use clap::{Args, Parser, Subcommand};
use std::path::PathBuf;

/// Patch text files and source code by rules.
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct Cli {
  #[command(subcommand)]
  pub r#type: SmartPatcherExecType,
}

#[derive(Subcommand, Debug)]
pub enum SmartPatcherExecType {
  /// Apply patches
  Apply(PatchParams),

  /// Test run
  Test(PatchParams),

  #[cfg(feature = "generate-examples")]
  /// Generate example patches
  GenerateExamples,
}

#[derive(Args, Debug)]
pub struct PatchParams {
  pub patch: PathBuf,
  pub work_at: PathBuf,
}