Cut the program down to absolute minimum I need. #1
+3
-4
@@ -7,7 +7,7 @@ use chrono::Local;
|
||||
|
||||
/// Command-line arguments using Clap.
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(author, version, about = "A tool for echoing latitude and longitude from a GPS USB dongle..")]
|
||||
#[command(author, version, about = "A tool for echoing latitude and longitude from a GPS USB dongle.")]
|
||||
struct Cli {
|
||||
|
||||
/// COM port
|
||||
@@ -19,13 +19,12 @@ fn main() {
|
||||
|
||||
let cli = Cli::parse();
|
||||
|
||||
|
||||
|
||||
let com = match cli.com {
|
||||
Some(com) => com,
|
||||
None => {
|
||||
// https://github.com/serialport/serialport-rs#listing-available-ports
|
||||
let ports = serialport::available_ports().expect("No ports found!");
|
||||
println!("Avaiable Ports:");
|
||||
println!("Available Ports:");
|
||||
for p in ports {
|
||||
println!("{}", p.port_name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user