git_helpe_rs/cli/
mod.rs

1use std::path::PathBuf;
2
3pub mod define;
4
5pub mod map_to_operation;
6
7pub enum Operation {
8    Commit,
9    BranchFromClipboard,
10    BranchFromTemplate,
11    SetCommitFormat,
12    SetBranchFormat,
13    SetBranchPrefix,
14    Show,
15}
16
17pub struct SetFormat {
18    pub key: String,
19    pub value: String,
20}
21
22pub struct CheckoutToPrefix {
23    pub prefix_key: String,
24    pub copy: bool,
25    pub dry_run: bool,
26}
27
28pub struct DryRunAndCopyFlag {
29    pub dry_run: bool,
30    pub copy: bool,
31}
32
33pub struct UseTemplate {
34    pub key: String,
35    pub interpolate_values: Vec<String>,
36    pub use_autocomplete: bool,
37    pub copy: bool,
38    pub dry_run: bool,
39}
40
41pub struct CommitSubcommandFlags {
42    pub use_branch_number: bool,
43    pub copy: bool,
44    pub dry_run: bool,
45}
46
47pub struct CommitOperationArguments {
48    pub use_template: UseTemplate,
49    pub flags: CommitSubcommandFlags,
50}
51pub struct SetClipboardCommands {
52    pub copy: String,
53    pub paste: String,
54}
55
56pub enum OperationWithArguments {
57    Commit(CommitOperationArguments),
58    BranchFromClipboard(CheckoutToPrefix),
59    BranchFromTemplate(UseTemplate),
60    SetCommitFormat(SetFormat),
61    SetBranchFormat(SetFormat),
62    SetBranchPrefix(SetFormat),
63    SetClipboardCommands(SetClipboardCommands),
64    Show,
65    GenerateAutocompletionScript(PathBuf),
66}
67
68pub struct ParsedArguments {
69    pub operation_with_arguments: OperationWithArguments,
70    pub path_to_config: PathBuf,
71}