-
-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Argument --display-offset
overrides position in sidebar, not offsets it.
#115
Comments
FYI @tommilligan: only if you are interested.. since you implemented |
Disclaimer: I'm interested in resolving this. Right now, I'm just going to triage things, but I hope to have a solution after I finish researching and put in my vote for my elections as a US resident. To me, the implemented behavior is desirable, and it's the documentation that should be re-aligned with current behavior -- this looks like docs I missed updating in my PR for |
I think you could argue this both ways if we were implementing the first hex viewer - however, the behaviour pointed out by @eth-p is the behaviour implemented by Example: $ cat LICENSE-MIT | head -n1 | hexyl -s 0x10 -o 0x20
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000020│ 72 65 62 79 20 67 72 61 ┊ 6e 74 65 64 2c 20 66 72 │reby gra┊nted, fr│
│00000030│ 65 65 20 6f 66 20 63 68 ┊ 61 72 67 65 2c 20 74 6f │ee of ch┊arge, to│
│00000040│ 20 61 6e 79 20 70 65 72 ┊ 73 6f 6e 20 6f 62 74 61 │ any per┊son obta│
│00000050│ 69 6e 69 6e 67 20 61 20 ┊ 63 6f 70 79 0a │ining a ┊copy_ │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
$ cat LICENSE-MIT | head -n1 | xxd -s 0x10 -o 0x20
00000030: 7265 6279 2067 7261 6e74 6564 2c20 6672 reby granted, fr
00000040: 6565 206f 6620 6368 6172 6765 2c20 746f ee of charge, to
00000050: 2061 6e79 2070 6572 736f 6e20 6f62 7461 any person obta
00000060: 696e 696e 6720 6120 636f 7079 0a ining a copy. |
Opened #119 |
I agree 👍 |
According to the help text,
--display-offset
should add to the file position sidebar's offset:In practice, this is actually not the case. Rather than adding the offset, it sets the offset. That means that when using
--display-offset
in conjunction with--skip
, the usual interactions between--skip
and the position are negated entirely. For example:With those arguments, it should have started at
1FF
instead of100
.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 :)
The text was updated successfully, but these errors were encountered: