diff options
author | Minijackson <minijackson@riseup.net> | 2018-10-08 00:35:46 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2018-10-08 00:35:46 +0200 |
commit | 9c66dd87be5cba1548b8a47e45fab8f8b8590b24 (patch) | |
tree | d09308c6aa64f58cee7c164371f109ec83bc44d3 /src | |
parent | 103fee7fa38367be5b8d222124a4aeb3aba995fb (diff) | |
download | set_eq-9c66dd87be5cba1548b8a47e45fab8f8b8590b24.tar.gz set_eq-9c66dd87be5cba1548b8a47e45fab8f8b8590b24.zip |
Add some long alternative option names
Diffstat (limited to 'src')
-rw-r--r-- | src/cli.rs | 36 |
1 files changed, 19 insertions, 17 deletions
@@ -1,5 +1,5 @@ | |||
1 | use clap_verbosity_flag; | ||
2 | use clap_log_flag; | 1 | use clap_log_flag; |
2 | use clap_verbosity_flag; | ||
3 | use structopt; | 3 | use structopt; |
4 | 4 | ||
5 | #[derive(StructOpt, Debug)] | 5 | #[derive(StructOpt, Debug)] |
@@ -10,7 +10,7 @@ pub struct Cli { | |||
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")] | 13 | #[structopt(short = "s", long = "sink")] |
14 | /// Use the given sink. | 14 | /// Use the given sink. |
15 | /// | 15 | /// |
16 | /// By default it will use the last equalized sink it finds | 16 | /// By default it will use the last equalized sink it finds |
@@ -21,16 +21,16 @@ pub struct Cli { | |||
21 | 21 | ||
22 | #[derive(StructOpt, Debug)] | 22 | #[derive(StructOpt, Debug)] |
23 | pub enum Command { | 23 | pub enum Command { |
24 | #[structopt(name = "pa-eq")] | 24 | #[structopt(name = "pa-eq")] |
25 | /// PulseAudio equalizer related commands | 25 | /// PulseAudio equalizer related commands |
26 | /// | 26 | /// |
27 | /// Warning: the PulseAudio equalizer has been deprecated for a while, | 27 | /// Warning: the PulseAudio equalizer has been deprecated for a while, |
28 | /// and is known to sometimes cause crashes, latency or audible | 28 | /// and is known to sometimes cause crashes, latency or audible |
29 | /// artifacts | 29 | /// artifacts |
30 | PaEq(pa_eq::Command), | 30 | PaEq(pa_eq::Command), |
31 | #[structopt(name = "pa-effects")] | 31 | #[structopt(name = "pa-effects")] |
32 | /// PulseEffects equalizer related commands | 32 | /// PulseEffects equalizer related commands |
33 | PaEffects(pa_effects::Command), | 33 | PaEffects(pa_effects::Command), |
34 | } | 34 | } |
35 | 35 | ||
36 | arg_enum! { | 36 | arg_enum! { |
@@ -45,7 +45,7 @@ pub mod pa_eq { | |||
45 | 45 | ||
46 | #[derive(StructOpt, Debug)] | 46 | #[derive(StructOpt, Debug)] |
47 | pub enum Command { | 47 | pub enum Command { |
48 | #[structopt(name = "load",)] | 48 | #[structopt(name = "load")] |
49 | /// Load and switch to a given equalizer configuration | 49 | /// Load and switch to a given equalizer configuration |
50 | Load(LoadCli), | 50 | Load(LoadCli), |
51 | #[structopt(name = "reset")] | 51 | #[structopt(name = "reset")] |
@@ -62,6 +62,7 @@ pub mod pa_eq { | |||
62 | pub file: String, | 62 | pub file: String, |
63 | #[structopt( | 63 | #[structopt( |
64 | short = "f", | 64 | short = "f", |
65 | long = "format", | ||
65 | raw( | 66 | raw( |
66 | possible_values = "&EqualizerConfFormat::variants()", | 67 | possible_values = "&EqualizerConfFormat::variants()", |
67 | case_insensitive = "true" | 68 | case_insensitive = "true" |
@@ -82,7 +83,7 @@ pub mod pa_effects { | |||
82 | 83 | ||
83 | #[derive(StructOpt, Debug)] | 84 | #[derive(StructOpt, Debug)] |
84 | pub enum Command { | 85 | pub enum Command { |
85 | #[structopt(name = "export-preset",)] | 86 | #[structopt(name = "export-preset")] |
86 | /// Export a PulseEffects preset | 87 | /// Export a PulseEffects preset |
87 | ExportPreset(ExportPresetCli), | 88 | ExportPreset(ExportPresetCli), |
88 | } | 89 | } |
@@ -96,6 +97,7 @@ pub mod pa_effects { | |||
96 | pub file: String, | 97 | pub file: String, |
97 | #[structopt( | 98 | #[structopt( |
98 | short = "f", | 99 | short = "f", |
100 | long = "format", | ||
99 | raw( | 101 | raw( |
100 | possible_values = "&EqualizerConfFormat::variants()", | 102 | possible_values = "&EqualizerConfFormat::variants()", |
101 | case_insensitive = "true" | 103 | case_insensitive = "true" |
@@ -104,14 +106,14 @@ pub mod pa_effects { | |||
104 | )] | 106 | )] |
105 | /// The file format of the equalizer configuration | 107 | /// The file format of the equalizer configuration |
106 | pub format: EqualizerConfFormat, | 108 | pub format: EqualizerConfFormat, |
107 | #[structopt(short = "p")] | 109 | #[structopt(short = "p", long = "base-preset")] |
108 | /// Use a given file as a base for PulseEffects preset instead of the | 110 | /// Use a given file as a base for PulseEffects preset instead of the |
109 | /// default one. | 111 | /// default one. |
110 | /// | 112 | /// |
111 | /// If "-" is given, read the base preset from the command-line. | 113 | /// If "-" is given, read the base preset from the command-line. |
112 | pub base_preset: Option<String>, | 114 | pub base_preset: Option<String>, |
113 | #[structopt(short = "o")] | 115 | #[structopt(short = "o", long = "output")] |
114 | /// Write the preset to the given file, instead of the standard output | 116 | /// Write the preset to the given file instead of the standard output |
115 | pub output: Option<String>, | 117 | pub output: Option<String>, |
116 | } | 118 | } |
117 | 119 | ||