ndd7xv / heh

A terminal UI to edit bytes by the nibble.
MIT License
444 stars 18 forks source link

Add `--offset` option #38

Closed ndd7xv closed 1 year ago

ndd7xv commented 1 year ago

Add an --offset option so that users can use it from the command line and immediately be at the specified offset in the file.

For example:

heh <file> --offset 0x10FF90

Should put the cursor at position 0x10FF90.

  1. The offset should be able to read hex or decimal. If it can't be parsed then make the cursor position 0.
  2. If the offset is negative, set the cursor position to the 0 byte (maybe add notification?).
  3. If the offset is larger than the file size, set the cursor position to the last byte (maybe add notification?).