23 lines
606 B
Rust
23 lines
606 B
Rust
|
use clap::{crate_authors, crate_version, AppSettings, Parser};
|
||
|
|
||
|
#[derive(Debug, Parser)]
|
||
|
pub enum Command {
|
||
|
/// Verifies if the configuration can be parsed without errors
|
||
|
Configtest,
|
||
|
}
|
||
|
|
||
|
#[derive(Debug, Parser)]
|
||
|
#[clap(
|
||
|
version = crate_version!(),
|
||
|
author = crate_authors!(", "),
|
||
|
global_setting = AppSettings::InferSubcommands,
|
||
|
global_setting = AppSettings::PropagateVersion,
|
||
|
)]
|
||
|
pub struct Opts {
|
||
|
/// Provide a path to the configuration file
|
||
|
#[clap(short, long, value_name = "FILE")]
|
||
|
pub config: Option<String>,
|
||
|
#[clap(subcommand)]
|
||
|
pub command: Option<Command>,
|
||
|
}
|