Update CLI help style

This commit is contained in:
mtkennerly 2023-12-10 16:47:32 +08:00
parent 7ea1ea2ca4
commit 311dd4139d
No known key found for this signature in database
GPG key ID: E764BE00BE6E6408
3 changed files with 29 additions and 6 deletions

View file

@ -8,8 +8,18 @@ use crate::{
Error,
};
fn styles() -> clap::builder::styling::Styles {
use clap::builder::styling::{AnsiColor, Effects, Styles};
Styles::styled()
.header(AnsiColor::Yellow.on_default() | Effects::BOLD)
.usage(AnsiColor::Yellow.on_default() | Effects::BOLD)
.literal(AnsiColor::Green.on_default() | Effects::BOLD)
.placeholder(AnsiColor::Green.on_default())
}
#[derive(clap::Parser, Clone, Debug, PartialEq, Eq)]
#[clap(name = "ludusavi", version, term_width = 79)]
#[clap(name = "ludusavi-manifest", version, max_term_width = 100, next_line_help = true, styles = styles())]
pub struct Cli {
#[clap(subcommand)]
pub sub: Subcommand,
@ -34,9 +44,11 @@ pub enum Subcommand {
},
/// Fetch a named subset of games.
Solo {
/// Only use local data.
#[clap(long)]
local: bool,
/// Games to update, by wiki article title.
#[clap()]
games: Vec<String>,
},