Skip to content

Commit

Permalink
Merge pull request #3 from AndreasOM/main
Browse files Browse the repository at this point in the history
+ Add hex and binary support to poke values. Partially addresses #2.
  • Loading branch information
mlund committed Jan 17, 2024
2 parents 4658b73 + 182b423 commit 6745149
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ enum Commands {
Poke {
/// Address to write to, e.g. `4096` or `0x1000`
address: String,
/// Value to write
/// Value to write, e.g. `16`, `0x10` or `0b0001_0000`
#[arg(value_parser = parse_u8)]
value: u8,
},
/// Power off machine
Expand All @@ -134,6 +135,9 @@ enum Commands {
},
}

fn parse_u8(arg: &str) -> Result<u8, std::num::ParseIntError> {
parse::<u8>(arg)
}
/// Disassemble `length` bytes from memory, starting at `address`
/// # Panics
/// Panics if the disassembler fails to disassemble the bytes
Expand Down

0 comments on commit 6745149

Please sign in to comment.