-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathcli.rs
28 lines (26 loc) · 855 Bytes
/
cli.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use crate::actions::{config::ConfigArgs, prepare_commit_msg::PrepareCommitMsgArgs};
use clap::{Parser, Subcommand};
/// Represents the main command-line interface for the application.
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
#[command(propagate_version = true)]
pub(crate) struct GptcommitCLI {
/// The action to perform (subcommand).
#[command(subcommand)]
pub action: Action,
/// Enable verbose logging.
#[arg(short, long, global = true)]
pub verbose: bool,
}
/// Actions the application can perform.
#[derive(Subcommand, Debug)]
pub(crate) enum Action {
/// Install the git hook
Install,
/// Uninstall the git hook
Uninstall,
/// Read and modify settings
Config(ConfigArgs),
/// Run on the prepare-commit-msg hook
PrepareCommitMsg(PrepareCommitMsgArgs),
}