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)
This might make it more confusing for the moment, my goal would be to have something like
flashrom -p internal --ifd -i bios:cbfs.bin --mode write #1
for individual regions, and
flashrom -p internal -i all:some.rom --mode write #2
for the whole flash, where
flashrom -p internal -w some.rom #3
would be a shorthand for #2.
In any case, this is a step in the right direction by making full-sized filename optional. I'll be completely onboard if `flashrom -p internal --ifd -i bios:cbfs.bin -w` can be shorthand for #1 and `flashrom -p internal -i all:some.rom -w` can be shorthand for #2.
Well, I added a short form `-m` and a prefix check, so `-mw` would work. `-w` does still ask for a file name.
Otherwise, we should should deprecate -w/-r/-E/-v to be consistent for the various use cases.
I thought about that, too. But the old syntax is really handy when it comes to flashing full files :-/
https://review.coreboot.org/#/c/30979/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/30979/2//COMMIT_MSG@14 PS2, Line 14: provide better error messages.
I'm not sure what is so complex... […]
The parsing part is solved, Arthur looked after that in 23022. Not easy to read, but acceptable.
But the optional arguments make it hard to guess what the user intended, e.g. I think currently it would tell the user to specify files for each region even if he maybe just forgot to specify the full flash-chip file. Having different syntaxes for each case evades this problem.