Skip to content

Commit

Permalink
Add more explanation for the --breakpoints flag
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasKalbertodt committed Aug 26, 2018
1 parent 1395c97 commit b256fe8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions desktop/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ pub(crate) struct Args {
parse(try_from_str = "parse_breakpoint"),
requires = "debug",
help = "Breakpoint that is added to the debugger at the very beginning. Breakpoints are \
specified in hexadecimal.",
specified in hexadecimal. To add multiple breakpoints, you can either list them after \
one `--breakpoints` flag or specify `--breakpoints` multiple times. Example: \
`--breakpoints 23 FF --breakpoints 10B`.",
)]
pub(crate) breakpoints: Vec<Word>,

Expand Down Expand Up @@ -63,5 +65,9 @@ fn parse_scale(src: &str) -> Result<Scale, &'static str> {
fn parse_breakpoint(src: &str) -> Result<Word, String> {
u16::from_str_radix(src, 16)
.map(Word::new)
.map_err(|e| format!("failed to parse breakpoint: {}", e))
.map_err(|e| format!(
"failed to parse breakpoint: {} (values like '1f' are valid -- no \
leading `0x`!)",
e,
))
}

0 comments on commit b256fe8

Please sign in to comment.