jacobrosenthal / hf2-rs

Microsoft HF2 HID Flashing Format for UF2 Bootloaders
49 stars 14 forks source link

cargo-hf2 parses `--vid` and `--pid` without bias towards hex #15

Open gkelly opened 4 years ago

gkelly commented 4 years ago

Most (all?) times that USB VID/PID values are written they are written as hexadecimal without the 0x prefix. This is confusing when using cargo hf2 because you end up with errors like:

$ cargo hf2 --vid 2886 --pid 002f --example blink
error: Invalid value for '--pid <pid>': invalid digit found in string

udev rules and lsusb both print these values without the 0x prefix, so it feels unergonomic to reject those same values here.

jacobrosenthal commented 4 years ago

I think it does parse hex but must need the 0x

On Sun, Apr 12, 2020, 5:39 PM Garret Kelly notifications@github.com wrote:

Most (all?) times that USB VID/PID values are written they are written as hexadecimal without the 0x prefix. This is confusing when using cargo hf2 because you end up with errors like:

$ cargo hf2 --vid 2886 --pid 002f --example blink error: Invalid value for '--pid ': invalid digit found in string

udev rules and lsusb both print these values without the 0x prefix, so it feels unergonomic to reject those same values here.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jacobrosenthal/hf2-rs/issues/15, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADPI5A5ZNMXD6DR5RFAEADRMJNMHANCNFSM4MGT6XBQ .

gkelly commented 4 years ago

I think it does parse hex but must need the 0x

Sorry, I didn't mention that but yes it definitely does do the right thing if you put the base prefix on the arguments.