Skip to content

Commit

Permalink
Error handling for arguments, smaller release binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Miller committed May 16, 2019
1 parent 4732e1e commit defc1de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ edition = "2018"
[dependencies]
serialport = "3.2.0"
reqwest = "0.9.16"

[profile.release]
lto = true
5 changes: 5 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ use std::env;
use std::io::{self, Write};
use std::str;
use std::time::Duration;
use std::process;

fn main() {
let args: Vec<String> = env::args().collect();
if args.len() != 3 {
println!("kubotton must takes two arguments: kubutton <path/to/serial/port> <http://url/to/hit/when/pressed>");
process::exit(1);
}
let port_name = &args[1];
let snack_url = &args[2];

Expand Down

0 comments on commit defc1de

Please sign in to comment.