scenarios when using `clap` for argument parsing with subcommands in Rust
I can't seem to get I'm stuck on something that should probably be simple. I'm working through a tutorial and I'm deploying to production and I'm trying to set up argument parsing in my Rust command-line application using the `clap` library, and I want to implement subcommands. However, I'm running into issues when trying to access the values of the arguments passed to the subcommands. Here’s what my `Cargo.toml` looks like: ```toml [dependencies] clap = "3.0" ``` My main code is structured like this: ```rust use clap::{App, Arg, SubCommand}; fn main() { let matches = App::new("myapp") .version("1.0") .about("Does awesome things") .subcommand(SubCommand::with_name("config") .about("Configures the application") .arg(Arg::with_name("set") .required(true) .takes_value(true))) .get_matches(); if let Some(matches) = matches.subcommand_matches("config") { match matches.value_of("set") { Some(value) => println!("Setting to: {}", value), None => println!("No value provided"), } } } ``` But when I run the program with the command `./myapp config --set value`, I get the behavior: `behavior: The argument '--set' was not provided an expected value`. It seems like `clap` is expecting the `set` argument to be provided before the `--set` flag. I’ve also tried using `set` without `--` but that doesn’t work either. I’ve checked the documentation and it mentions that `takes_value(true)` should work as expected. I’m using `clap` version 3.0.0. What am I missing here? Why is the argument not being recognized correctly? For reference, this is a production application. What's the correct way to implement this? For reference, this is a production web app. This is for a application running on CentOS. Thanks for any help you can provide! This is happening in both development and production on Ubuntu 22.04. What's the best practice here?