Attention is currently required from: David Hendricks, Daniel Campello, Angel Pons, Anastasia Klimchuk, Nikolai Artemiev. Nico Huber 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:
I believe the main difference between this approach and CB:52362 is that this -m argument is only ne […] TBH, I'm not very convinced of either version. One downside of the optional argument that I probably didn't repeat lately: Typos in the command line can become more severe (but not as bad as with the non-positional argument). For instance, consider this:
$ flashrom -p prog --ifd -i bios:bios.bin -r 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. On the wiki[1], I once came up with this: [-i <region>]... (-r|-w|-v [<region>:]<filename>)... I'm not sure anymore, why I implemented `--mode` instead. It seems the classic CLI will grow further anyway. If we'd start with this: [-i <region>[:<file>]]... -r|-w|-v [<filename>] We could still later add a (-r|-w|-v [[<region>:]<filename>]) notation. Then we'd stay Cr compatible but nobody would have to use the error-prone optional argument. It would also be easier to have compile-time switches, e.g. to make the file argument optional. If we'd decide to go this way, I'd prefer to have only the latter syntax added to the help text / man page. What do you think? The idea is rather new to me, I still haven't made up my mind. [1] https://flashrom.org/Per_region_file_arguments#More_explicit_alternative -- To view, visit https://review.coreboot.org/c/flashrom/+/30979 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: flashrom Gerrit-Branch: master Gerrit-Change-Id: Idfba11ec9991aac423b07f68f7dc45e7bebbb06b Gerrit-Change-Number: 30979 Gerrit-PatchSet: 2 Gerrit-Owner: Nico Huber <nico.h@gmx.de> Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org> Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com> Gerrit-Reviewer: Arthur Heymans <arthur@aheymans.xyz> Gerrit-Reviewer: Carl-Daniel Hailfinger <hailfinger@gmail.com> Gerrit-Reviewer: Daniel Campello <campello@chromium.org> Gerrit-Reviewer: David Hendricks <david.hendricks@gmail.com> Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org> Gerrit-Reviewer: Nico Huber <nico.h@gmx.de> Gerrit-Reviewer: Nikolai Artemiev <nartemiev@google.com> Gerrit-Reviewer: Paul Menzel <paulepanter@mailbox.org> Gerrit-Reviewer: Stefan T <stefan.tauner@gmx.at> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-Attention: David Hendricks <david.hendricks@gmail.com> Gerrit-Attention: Daniel Campello <campello@chromium.org> Gerrit-Attention: Angel Pons <th3fanbus@gmail.com> Gerrit-Attention: Anastasia Klimchuk <aklm@chromium.org> Gerrit-Attention: Nikolai Artemiev <nartemiev@google.com> Gerrit-Comment-Date: Sat, 08 May 2021 11:43:06 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: Daniel Campello <campello@chromium.org> Gerrit-MessageType: comment