1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
use clap::Parser;
/// Commandline options
#[derive(Debug, Parser)]
#[clap(author, version, about, long_about = None, after_long_help = include_str!("cli/after_long_help.md"))]
pub struct Options {
/// Pass arguments directly to upstream git without executing any overrides
#[clap(long)]
pub upstream: bool,
/// Arguments to pass to upstream git or overrides
pub args: Vec<String>,
}
impl Options {
pub fn parse() -> Options {
// This simply exports the trait method without caller needing to use the trait:
<Options as Parser>::parse()
}
}