Args

Define the command-line interface structure using the clap library. Set up two subcommands: ReadCount and IncrementCount, each with their respective arguments. The Shared struct is used to define common arguments for both subcommands.

#![allow(unused)]
fn main() {
#[derive(Parser)]
#[command(version, about, long_about = None)]
struct Cli {
    #[command(subcommand)]
    command: Command,
}

#[derive(Subcommand)]
enum Command {
    ReadCount {
        #[command(flatten)]
        server: Shared,
    },
    IncrementCount {
        /// The address of the builder to connect to.
        builder_api: String,
        #[command(flatten)]
        server: Shared,
    },
}

#[derive(Args)]
pub struct Shared {
    /// The address of the node to connect to.
    pub node_api: String,
    /// The directory containing the pint files.
    pub pint_directory: PathBuf,
}
}