diff options
author | Minijackson <minijackson@riseup.net> | 2018-10-08 15:41:46 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2018-10-08 15:41:46 +0200 |
commit | d35f0c9ee105f8c789827d6f5c740154f7b9b1bc (patch) | |
tree | f357c25cabbeeb455863a502a35e1f1d79d4b16e /src/cli.rs | |
parent | 9c66dd87be5cba1548b8a47e45fab8f8b8590b24 (diff) | |
download | set_eq-d35f0c9ee105f8c789827d6f5c740154f7b9b1bc.tar.gz set_eq-d35f0c9ee105f8c789827d6f5c740154f7b9b1bc.zip |
Use features to separate pa_eq and pa_effects + slightly better logging
Diffstat (limited to 'src/cli.rs')
-rw-r--r-- | src/cli.rs | 24 |
1 files changed, 17 insertions, 7 deletions
@@ -4,23 +4,19 @@ use structopt; | |||
4 | 4 | ||
5 | #[derive(StructOpt, Debug)] | 5 | #[derive(StructOpt, Debug)] |
6 | #[structopt(raw(setting = "structopt::clap::AppSettings::ColoredHelp"))] | 6 | #[structopt(raw(setting = "structopt::clap::AppSettings::ColoredHelp"))] |
7 | /// Hello World! How are you doing? | 7 | /// A command-line tool to manipulate PulseAudio's equalizers |
8 | pub struct Cli { | 8 | pub struct Cli { |
9 | #[structopt(flatten)] | 9 | #[structopt(flatten)] |
10 | pub verbose: clap_verbosity_flag::Verbosity, | 10 | pub verbose: clap_verbosity_flag::Verbosity, |
11 | #[structopt(flatten)] | 11 | #[structopt(flatten)] |
12 | pub log: clap_log_flag::Log, | 12 | pub log: clap_log_flag::Log, |
13 | #[structopt(short = "s", long = "sink")] | ||
14 | /// Use the given sink. | ||
15 | /// | ||
16 | /// By default it will use the last equalized sink it finds | ||
17 | pub sink: Option<String>, | ||
18 | #[structopt(subcommand)] | 13 | #[structopt(subcommand)] |
19 | pub cmd: Command, | 14 | pub cmd: Command, |
20 | } | 15 | } |
21 | 16 | ||
22 | #[derive(StructOpt, Debug)] | 17 | #[derive(StructOpt, Debug)] |
23 | pub enum Command { | 18 | pub enum Command { |
19 | #[cfg(feature = "pa-eq")] | ||
24 | #[structopt(name = "pa-eq")] | 20 | #[structopt(name = "pa-eq")] |
25 | /// PulseAudio equalizer related commands | 21 | /// PulseAudio equalizer related commands |
26 | /// | 22 | /// |
@@ -28,6 +24,7 @@ pub enum Command { | |||
28 | /// and is known to sometimes cause crashes, latency or audible | 24 | /// and is known to sometimes cause crashes, latency or audible |
29 | /// artifacts | 25 | /// artifacts |
30 | PaEq(pa_eq::Command), | 26 | PaEq(pa_eq::Command), |
27 | #[cfg(feature = "pa-effects")] | ||
31 | #[structopt(name = "pa-effects")] | 28 | #[structopt(name = "pa-effects")] |
32 | /// PulseEffects equalizer related commands | 29 | /// PulseEffects equalizer related commands |
33 | PaEffects(pa_effects::Command), | 30 | PaEffects(pa_effects::Command), |
@@ -40,6 +37,7 @@ arg_enum! { | |||
40 | } | 37 | } |
41 | } | 38 | } |
42 | 39 | ||
40 | #[cfg(feature = "pa-eq")] | ||
43 | pub mod pa_eq { | 41 | pub mod pa_eq { |
44 | use super::EqualizerConfFormat; | 42 | use super::EqualizerConfFormat; |
45 | 43 | ||
@@ -71,13 +69,25 @@ pub mod pa_eq { | |||
71 | )] | 69 | )] |
72 | /// The file format of the equalizer configuration | 70 | /// The file format of the equalizer configuration |
73 | pub format: EqualizerConfFormat, | 71 | pub format: EqualizerConfFormat, |
72 | #[structopt(short = "s", long = "sink")] | ||
73 | /// Use the given sink. | ||
74 | /// | ||
75 | /// By default it will use the last equalized sink it finds | ||
76 | pub sink: Option<String>, | ||
74 | } | 77 | } |
75 | 78 | ||
76 | #[derive(StructOpt, Debug)] | 79 | #[derive(StructOpt, Debug)] |
77 | pub struct ResetCli {} | 80 | pub struct ResetCli { |
81 | #[structopt(short = "s", long = "sink")] | ||
82 | /// Use the given sink. | ||
83 | /// | ||
84 | /// By default it will use the last equalized sink it finds | ||
85 | pub sink: Option<String>, | ||
86 | } | ||
78 | 87 | ||
79 | } | 88 | } |
80 | 89 | ||
90 | #[cfg(feature = "pa-effects")] | ||
81 | pub mod pa_effects { | 91 | pub mod pa_effects { |
82 | use super::EqualizerConfFormat; | 92 | use super::EqualizerConfFormat; |
83 | 93 | ||