Closed eth-p closed 3 years ago
Thanks. A nicer error message would be great, yes.
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.
This is interesting -- on my Windows machine, I get very different results:
$ echo asdf > large-negative-seek-wont-work-here
$ hexyl large-negative-seek-wont-work-here --skip=-2
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 61 73 64 66 0a ┊ │asdf_ ┊ │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
$ hexyl large-negative-seek-wont-work-here --skip=-2gib
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 61 73 64 66 0a ┊ │asdf_ ┊ │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
$ hexyl large-negative-seek-wont-work-here --skip=-1
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 61 73 64 66 0a ┊ │asdf_ ┊ │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
Yuck.
@ErichDonGubler are you using latest master
on Windows? I just added some tests in #122 and they seem to succeed on Windows. If the issues persist, could you please open a new ticket?
I also updated the error message, so this ticket can be closed.
I'm not too sure how other platforms handle this one, but on MacOS it will print "Error: Invalid argument (os error 22)" and then immediately exit with exit code 1.
Example:
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 :)