summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index f9e91a3..3103f5f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -67,13 +67,19 @@ fn main() {
info!("Read {} unit definitions", units.count());
info!("Read {} derived definitions", derived.count());
+ let args: Vec<String> = args().collect();
+ let iface = if args.len() > 1 {
+ args[1].clone()
+ } else {
+ "vcan0".into()
+ };
+
+ if iface.len() == 0 {
+ info!("Stopping now");
+ return;
+ }
+
let world = futures::future::lazy(move || {
- let args: Vec<String> = args().collect();
- let iface = if args.len() > 1 {
- args[1].clone()
- } else {
- "vcan0".into()
- };
info!("Connecting Canopied to {}", iface);
let (sink, stream) = isotp::ISOTP::new(&iface).split();
let (sender, receiver) = mpsc::channel(100);