From d35f0c9ee105f8c789827d6f5c740154f7b9b1bc Mon Sep 17 00:00:00 2001 From: Minijackson Date: Mon, 8 Oct 2018 15:41:46 +0200 Subject: Use features to separate pa_eq and pa_effects + slightly better logging --- src/cli.rs | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'src/cli.rs') diff --git a/src/cli.rs b/src/cli.rs index 4dee538..704c13f 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -4,23 +4,19 @@ use structopt; #[derive(StructOpt, Debug)] #[structopt(raw(setting = "structopt::clap::AppSettings::ColoredHelp"))] -/// Hello World! How are you doing? +/// A command-line tool to manipulate PulseAudio's equalizers pub struct Cli { #[structopt(flatten)] pub verbose: clap_verbosity_flag::Verbosity, #[structopt(flatten)] pub log: clap_log_flag::Log, - #[structopt(short = "s", long = "sink")] - /// Use the given sink. - /// - /// By default it will use the last equalized sink it finds - pub sink: Option, #[structopt(subcommand)] pub cmd: Command, } #[derive(StructOpt, Debug)] pub enum Command { + #[cfg(feature = "pa-eq")] #[structopt(name = "pa-eq")] /// PulseAudio equalizer related commands /// @@ -28,6 +24,7 @@ pub enum Command { /// and is known to sometimes cause crashes, latency or audible /// artifacts PaEq(pa_eq::Command), + #[cfg(feature = "pa-effects")] #[structopt(name = "pa-effects")] /// PulseEffects equalizer related commands PaEffects(pa_effects::Command), @@ -40,6 +37,7 @@ arg_enum! { } } +#[cfg(feature = "pa-eq")] pub mod pa_eq { use super::EqualizerConfFormat; @@ -71,13 +69,25 @@ pub mod pa_eq { )] /// The file format of the equalizer configuration pub format: EqualizerConfFormat, + #[structopt(short = "s", long = "sink")] + /// Use the given sink. + /// + /// By default it will use the last equalized sink it finds + pub sink: Option, } #[derive(StructOpt, Debug)] - pub struct ResetCli {} + pub struct ResetCli { + #[structopt(short = "s", long = "sink")] + /// Use the given sink. + /// + /// By default it will use the last equalized sink it finds + pub sink: Option, + } } +#[cfg(feature = "pa-effects")] pub mod pa_effects { use super::EqualizerConfFormat; -- cgit v1.2.3