aboutsummaryrefslogtreecommitdiff
path: root/src/config/args.rs
blob: f8ad8e8f2dba3c902037fe828d501421abeabb17 (plain)
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
use clap::{Parser, Subcommand};

#[derive(Parser, Clone, Debug)]
#[clap(override_usage("gtree <SUBCOMMAND> [SCOPE]"))]
/// Sync Gitlab Trees
pub struct Args {
    #[clap(subcommand)]
    pub command: Commands,

    /// Only operate on this subtree
    #[clap(global = true)]
    pub scope: Option<String>,

    /// Number of jobs to run in parallel, 0 is automatic
    #[clap(short = 'j', long = "jobs", default_value = "0", global = true)]
    pub jobs: usize,
}

#[derive(PartialEq, Clone, Debug, Subcommand)]
pub enum Commands {
    /// Download new repositories and delete old ones, also update
    Sync,
    /// Pull and Push new commits to and from the cloned repos
    Update,
    /// List Directories
    List,
}