Initial commit

To implement commands `clap` is used to parse arguments.
This commit is contained in:
finga 2021-06-12 16:26:48 +02:00
commit 2b96bcc562
5 changed files with 289 additions and 0 deletions

15
src/cli.rs Normal file
View file

@ -0,0 +1,15 @@
use clap::{crate_authors, crate_version, AppSettings, Clap};
#[derive(Clap, Debug)]
#[clap(
version = crate_version!(),
author = crate_authors!(", "),
setting = AppSettings::SubcommandRequiredElseHelp,
global_setting = AppSettings::VersionlessSubcommands,
global_setting = AppSettings::InferSubcommands,
)]
pub struct Opts {
/// Produce verbose output
#[clap(short, long, global = true)]
pub verbose: bool,
}

9
src/main.rs Normal file
View file

@ -0,0 +1,9 @@
use clap::Clap;
mod cli;
use cli::Opts;
fn main() {
Opts::parse();
}