Skip to content

Commit

Permalink
Now added a subcommand to run the bot
Browse files Browse the repository at this point in the history
  • Loading branch information
Lol3rrr committed Oct 31, 2023
1 parent 0929a3f commit 8036f70
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@ async fn main() {
tracing::subscriber::set_global_default(layers).unwrap();

let args = clap::Command::new("Gold-Pass-Bot")
.arg(
clap::Arg::new("storage")
.long("storage")
.value_names(["storage-target"]),
.subcommand(
clap::Command::new("bot").arg(
clap::Arg::new("storage")
.long("storage")
.value_names(["storage-target"]),
),
)
.get_matches();
tracing::debug!("Args: {:#?}", args);

let mut storage_backend = args
.subcommand_matches("bot")
.unwrap()
.get_one::<String>("storage")
.map(|arg: &String| gold_pass_bot::parse_storage(&arg))
.unwrap()
Expand Down

0 comments on commit 8036f70

Please sign in to comment.