From 1e7907358ff7d6350045a0631089891ee70c2544 Mon Sep 17 00:00:00 2001 From: Dennis Date: Thu, 26 Jul 2018 18:44:28 +0200 Subject: [PATCH] Replaced -v/--value by -i/--input Users could make the mistake and set -V, which is valid in every scrope, in stead of -v. This could result in for the user unexplainable behaviour. --- src/main.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0374e71..7713e0f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,9 +43,9 @@ enum Command { #[structopt(short = "c", long = "command")] command: Vec, - /// Value to apply - #[structopt(short = "v", long = "value")] - value: Vec, + /// Input values to apply + #[structopt(short = "i", long = "input")] + input: Vec, }, #[structopt(name = "read")] @@ -63,10 +63,11 @@ enum Command { fn main() { let mut pedals = pedal_operations::Pedals::new(); + let opt = Opt::from_args(); + welcome("footswitch-rs, Dennis Potter "); check_sudo(); - let opt = Opt::from_args(); // All options that don't need the device to be open // Print all keys and exit application @@ -104,9 +105,9 @@ fn main() { // All options that need the device to be open match opt.cmd { - Some(Command::Write {pedal: ped_list, command: cmd_list, value: val_list}) => { + Some(Command::Write {pedal: ped_list, command: cmd_list, input: val_list}) => { if ped_list.len() != cmd_list.len() && ped_list.len() != val_list.len() { - error!("You must define as much pedals as you define commands and as you define values!"); + error!("You must define as much pedals as you define commands and as you define input values!"); } for (i, cmd) in cmd_list.iter().enumerate() { @@ -130,7 +131,7 @@ fn main() { pedals.write_pedals(& dev); info!("Succesfully wrote everything to footpedal!"); - info!("The current state of the device is shown below.\n"); + info!("The current state of the device is shown below."); // Show user current state of pedal pedals.read_pedals(&dev, vec![0,1,2]);