diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/config/args.rs | 13 | ||||
| -rw-r--r-- | src/main.rs | 4 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/config/args.rs b/src/config/args.rs index 1b0683d..9c0973f 100644 --- a/src/config/args.rs +++ b/src/config/args.rs @@ -1,18 +1,21 @@ -use structopt::StructOpt; +use clap::{Parser, Subcommand, ArgEnum}; -#[derive(StructOpt, Clone, Debug)] +#[derive(Parser, Clone, Debug)] +#[clap( + override_usage("gtree <SUBCOMMAND> [SCOPE]") +)] /// Sync Gitlab Trees pub struct Args { - #[structopt(subcommand)] + #[clap(subcommand)] pub command: Commands, /// Only operate on this subtree + #[clap(global = true)] pub scope: Option<String>, } #[derive(PartialEq, Clone, Debug)] -#[derive(StructOpt)] -#[structopt(about = "the stupid content tracker")] +#[derive(Subcommand)] pub enum Commands { /// Download new repositories and delete old ones, also update Sync, diff --git a/src/main.rs b/src/main.rs index 748f50d..2a6592e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ use anyhow::{Context, Result}; -use structopt::StructOpt; +use clap::Parser; use derivative::Derivative; use tracing::{debug, info, metadata::LevelFilter, trace, Level}; @@ -26,7 +26,7 @@ struct GTree { impl GTree { pub async fn new() -> Result<GTree> { - let args = config::args::Args::from_args(); + let args = config::args::Args::parse(); let figment = config::Config::figment()?; let config: config::Config = figment.extract()?; |
