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