Skip to main content

cyto_cli/
cli.rs

1use super::Commands;
2use clap::{
3    builder::{
4        styling::{AnsiColor, Effects},
5        Styles,
6    },
7    Parser,
8};
9
10// Configures Clap v3-style help menu colors
11const STYLES: Styles = Styles::styled()
12    .header(AnsiColor::Green.on_default().effects(Effects::BOLD))
13    .usage(AnsiColor::Green.on_default().effects(Effects::BOLD))
14    .literal(AnsiColor::Cyan.on_default().effects(Effects::BOLD))
15    .placeholder(AnsiColor::Yellow.on_default());
16
17#[derive(Parser)]
18#[command(styles = STYLES)]
19#[clap(author, version, about, long_about = None)]
20pub struct Cli {
21    #[clap(subcommand)]
22    pub command: Commands,
23}
24impl Cli {
25    #[allow(clippy::new_without_default)]
26    pub fn new() -> Self {
27        Self::parse()
28    }
29}