Attention is currently required from: Nico Huber, David Hendricks, Angel Pons, Anastasia Klimchuk, Nikolai Artemiev. Daniel Campello has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/30979 )
Change subject: [RFC] cli_classic: Add `--mode (read|write|verify|erase)` parameter ......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2:
And then you want to add a `-V` but miss the dash, it would still be accepted:
$ flashrom -p prog --ifd -i bios:bios.bin -r V
It's not very bad. IIRC, with the non-positional argument one could do much funnier things.
Agree here! At least it seems to me that it just a concern for --read (which makes it non-dangerous), since for the other two (-w/-v) it would be a lot of bad luck to have a filename called V (still possible) while making the typo.
On the wiki[1], I once came up with this:
[-i <region>]... (-r|-w|-v [<region>:]<filename>)...
I think the complication with this approach is to support multiple file regions in a single operation. We would have to enforce multiple -r without the possibility of mixes between -r/-w/-v... Also, it means that we would have to move away form -i <region>:<filename> (or as you suggested bellow - not document it). Furthermore -i would only make sense if there is a chip size operation since otherwise is already embedded on the -r/-w/-v option. As an example of something that would not make much sense:
$ flashrom -i region1 -r region2:file # excluding a -r chip_file
[1] https://flashrom.org/Per_region_file_arguments#More_explicit_alternative
I probably should have clicked the link before starting replying as my concerns are documented there :)