Module common_options

Module common_options 

Source
Expand description

Collection of #[derive(StructOpt)] structs common to programs that extend then functionality of cargo-flash.

Example usage:

use clap::Parser;
use probe_rs_cli_util::common_options::FlashOptions;

#[derive(clap::Parser)]
struct Opts {
    #[clap(long = "some-opt")]
    opt: String,

    #[clap(flatten)]
    flash_options: FlashOptions,
}

fn main() {
    let opts = Opts::parse();

    opts.flash_options.probe_options.maybe_load_chip_desc().unwrap();

    // handle --list-{chips,probes}
    if opts.flash_options.early_exit(std::io::stdout()).unwrap() {
        return;
    }

    let target_session = opts.flash_options.probe_options.simple_attach().unwrap();

    // ...
}

Structs§

CargoOptions
Common options used when building artifacts with cargo.
FlashOptions
Common options when flashing a target device.
ProbeOptions
Common options and logic when interfacing with a Probe.

Enums§

OperationError

Functions§

list_connected_probes
Lists all connected debug probes.
print_chip_info
Print all the available families and their contained chips to the commandline.
print_families
Print all the available families and their contained chips to the commandline.