xmpd/music_mgr/src/config/cli.rs
2024-04-15 20:58:38 +03:00

42 lines
940 B
Rust

use camino::Utf8PathBuf;
use clap::{Parser, Subcommand};
use crate::util::isatty;
#[derive(Debug, Parser, Default)]
pub struct CliArgs {
/// Show more info
#[arg(long, short)]
pub debug: bool,
/// Path to manifest
#[arg(long, short, default_value_t=Utf8PathBuf::from("./manifest.json"))]
pub manifest: Utf8PathBuf,
/// Output directory
#[arg(long, short, default_value_t=Utf8PathBuf::from("./out"))]
pub output: Utf8PathBuf,
/// Config path
#[arg(long, short, default_value_t=Utf8PathBuf::from("./config.json"))]
pub config: Utf8PathBuf,
#[command(subcommand)]
pub command: Option<CliCommand>,
}
#[derive(Debug, Subcommand, Default)]
pub enum CliCommand {
#[default]
Download,
Add {
#[arg(long, short)]
url: Option<String>,
#[arg(long, short)]
name: Option<String>,
#[arg(long, short)]
genre: Option<String>
}
}