mirror of
https://github.com/msfjarvis/gitice
synced 2025-08-15 09:37:00 +05:30
switch to clap's derive macros
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
5eff1508ac
commit
27e73863ec
2 changed files with 39 additions and 43 deletions
31
src/cli.rs
Normal file
31
src/cli.rs
Normal file
|
@ -0,0 +1,31 @@
|
|||
use clap::{crate_version, Clap};
|
||||
|
||||
#[derive(Clap)]
|
||||
#[clap(version = crate_version!(), author = "Harsh Shandilya <me@msfjarvis.dev>")]
|
||||
pub(crate) struct Opts {
|
||||
#[clap(subcommand)]
|
||||
pub(crate) subcommand: SubCommand,
|
||||
}
|
||||
|
||||
#[derive(Clap)]
|
||||
pub(crate) enum SubCommand {
|
||||
Freeze(Freeze),
|
||||
Thaw(Thaw),
|
||||
}
|
||||
|
||||
/// recursively find git repos and record their states into a lockfile
|
||||
#[derive(Clap)]
|
||||
pub(crate) struct Freeze {
|
||||
/// directory to search and freeze repos from.
|
||||
pub(crate) directory: String,
|
||||
}
|
||||
|
||||
/// takes the given
|
||||
#[derive(Clap)]
|
||||
pub(crate) struct Thaw {
|
||||
/// directory to put cloned repos into.
|
||||
pub(crate) directory: String,
|
||||
/// the lockfile to restore repositories from.
|
||||
#[clap(default_value = "gitice.lock")]
|
||||
pub(crate) lockfile: String,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue