Closed eth-p closed 2 years ago
Side note: If this bug was fixed, how would hexyl handle
--block-size=1block
? Should it be multiplying it by the default value, or would it be more appropriate to treat as an error to avoid any confusion?
Interesting. I think that should be treated as an error, yes.
Disclaimer: I'm interested in resolving this. Right now, I'm just going to triage things, but I hope to have solution after I finish researching and put in my vote for my elections as a US resident.
The issue is valid, and the suggested resolution (where --block-size
can have a non-block
unit specified, otherwise an error is thrown) sounds great to me.
May I give this issue a try? Looks like there is no other activity anymore.
Yes, of course. Thank you
The
hexyl --help
description for the--block-size
argument goes as follows:However, when I attempt to run
hexyl "$(which hexyl)" -n 1block --block-size=4kB
, hexyl prints the following error:This is caused by the
block_size
argument being parsed as a positive i64 number, rather than as a data unit:https://github.com/sharkdp/hexyl/blob/cc5b308fc9c2ca57ba176cf69a237f13428bb8e3/src/bin/hexyl.rs#L133-L142
Side note: If this bug was fixed, how would hexyl handle
--block-size=1block
? Should it be multiplying it by the default value, or would it be more appropriate to treat as an error to avoid any confusion?Edit: It also doesn't accept hexadecimal numbers.
Note: I'm doing a class assignment regarding creating tests (from scratch) for an open-source command line program, and I chose hexyl for it. You might have a couple more of these on the way, depending on what the assignment brings to light :)