Skip to content

[Feature] Add a CLI argument to open file as read-only #2436

@lawm

Description

@lawm

What feature would you like to see?

Add a command-line argument, like --readonly or -r :
imhex --readonly file.bin

How will this feature be useful to you and others?

This could avoid accidentally changing and saving a file.

Request Type

  • I can provide a PoC for this feature or am willing to work on it myself and submit a PR

Additional context?

When I open a file and type something into the Pattern Editor, then try to close ImHex, it will ask:

You have unsaved changes made to your Project. Are you sure you want to exit?
Yes | No

I click Yes.

Then it asks:
Some changes haven't been saved to a Project yet. Do you want to save them before closing?
Yes | No | Cancel

I click No.

In order to exit without saving anything, I need to click "Yes" then "No". If I do this quickly and without reading, I'm afraid there could be changes to my file.

A readonly option would help. The dialogs could also be improved - reduce dialogs and put actions as the button text ("Save", "Don't save", "Exit without saving" )

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions