Skip to main content

smart_patcher/
cmd.rs

1use clap::{Args, Parser, Subcommand};
2use std::path::PathBuf;
3
4/// Patch text files and source code by rules.
5#[derive(Parser, Debug)]
6#[command(version, about, long_about = None)]
7pub struct Cli {
8  #[command(subcommand)]
9  pub r#type: SmartPatcherExecType,
10}
11
12#[derive(Subcommand, Debug)]
13pub enum SmartPatcherExecType {
14  /// Apply patches
15  Apply(PatchParams),
16
17  /// Test run
18  Test(PatchParams),
19
20  #[cfg(feature = "generate-examples")]
21  /// Generate example patches
22  GenerateExamples,
23}
24
25#[derive(Args, Debug)]
26pub struct PatchParams {
27  pub patch: PathBuf,
28  pub work_at: PathBuf,
29}