parsec_tool/cli/
mod.rs

1// Copyright 2020 Contributors to the Parsec project.
2// SPDX-License-Identifier: Apache-2.0
3
4//! Base CLI implementation.
5
6use crate::common::{PROJECT_AUTHOR, PROJECT_DESC, PROJECT_NAME, PROJECT_VERSION};
7use crate::subcommands::Subcommand;
8use structopt::StructOpt;
9
10/// Struct representing the command-line interface of parsec-tool.
11#[derive(Debug, StructOpt)]
12#[structopt(name=PROJECT_NAME, about=PROJECT_DESC, author=PROJECT_AUTHOR, version=PROJECT_VERSION)]
13pub struct ParsecToolApp {
14    /// The ID of the provider to target for the command. Will use the default provider if not specified.
15    #[structopt(short = "p", long = "provider")]
16    pub provider: Option<u8>,
17
18    /// The timeout time used for all commands in seconds. Will use the client's default if not specified. If
19    /// set to 0, will not use any timeout and will block indefinitely.
20    #[structopt(short = "t", long = "timeout")]
21    pub timeout: Option<u32>,
22
23    /// The subcommand -- e.g., ping.
24    #[structopt(subcommand)]
25    pub subcommand: Subcommand,
26}