Skip to content

Commit

Permalink
Add help strings for CLI options
Browse files Browse the repository at this point in the history
  • Loading branch information
pp3345 committed May 14, 2024
1 parent 8063375 commit 7b24156
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,22 @@ use powenetics_v2::{POWENETICS_USB_PID, POWENETICS_USB_VID};

mod csv;

/// Powenetics v2 command line tool
#[derive(Parser)]
struct Cli {
#[arg(long)]
/// Write measurement data to CSV file
#[arg(long, value_name = "path")]
csv: Option<PathBuf>,
/// Serial port name or path (run without arguments for list of available ports)
port: Option<String>,
}

fn main() -> Result<()> {
let args = Cli::parse();

if args.port.is_none() {
println!("Usage: see --help");

println!("Available serial ports:");

let ports = serialport::available_ports()?;
Expand Down

0 comments on commit 7b24156

Please sign in to comment.