use clap::builder::styling::{AnsiColor, Effects, Styles};
use clap::{Args, Parser, Subcommand};
fn styles() -> Styles {
Styles::styled()
.header(AnsiColor::Cyan.on_default() | Effects::BOLD)
.usage(AnsiColor::Cyan.on_default() | Effects::BOLD)
.literal(AnsiColor::Blue.on_default() | Effects::BOLD)
.error(AnsiColor::Red.on_default() | Effects::BOLD)
.placeholder(AnsiColor::Green.on_default())
}
#[derive(Parser, Debug, Clone)]
#[command(
author = "Mahmoud Harmouch",
version,
name = "os",
propagate_version = true,
styles = styles(),
help_template = r#"{before-help}{name} {version}
{about}
{usage-heading} {usage}
{all-args}{after-help}
AUTHORS:
{author}
"#,
about = r#"
██████ ██████ ███████ ███ ██ ███████ █████ ███████ ███████
██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██
██ ██ ██████ █████ ██ ██ ██ ███████ ███████ ███████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ██ ███████ ██ ████ ███████ ██ ██ ███████ ███████
`os` is a command-line interface for downloading and importing OpenSASS
components into your WASM projects.
FUNCTIONALITIES:
- Download OpenSASS components from crates.io.
- Automatically detect and import required dependencies and feature flags.
- Copy relevant source files into your local project for easy integration.
EXAMPLES:
Add the `i18nrs` component with `yew` feature:
os add i18nrs yew
Add the `i18nrs` component with `yew` feature while stripping all docs:
os add -n i18nrs yew
For more information, visit: https://github.com/opensass/cli
"#
)]
pub struct Cli {
#[command(subcommand)]
pub cmd: Option<Command>,
}
#[derive(Subcommand, Debug, Clone)]
pub enum Command {
Add(AddArgs),
}
#[derive(Args, Debug, Clone)]
pub struct AddArgs {
pub name: String,
pub features: String,
#[arg(short = 'n', long = "no-cum")]
pub no_cum: bool,
}