Attention is currently required from: Felix Singer, Thomas Heijligen, Edward O'Callaghan, Alexander Goncharov.

Alexander Goncharov uploaded patch set #8 to this change.

View Change

cli_classic: refactor arguments parsing into separate func

Move variables that represent parsed options to `cli_options`
structure. This patchset also introduces the following functions:

- parse_options() which parses command line arguments and fills
the structure.
- free_options() that releases an allocated data from the
structure.

This is one of the steps on the way to simplify the main function
by using helper functions with descriptive names.

TOPIC=split_main_func
TEST=the following scenarious run successfully

./flashrom -p dummy:emulate=S25FL128L -V
./flashrom -p dummy:size=8388608,emulate=VARIABLE_SIZE \
-r /tmp/dump.rom
./flashrom -p dummy:emulate=W25Q128FV -l /tmp/rom.layout \
-i boot -w /tmp/rom.tr.img
./flashrom -p dummy:emulate=W25Q128FV --wp-list
./flashrom -p dummy:emulate=W25Q128FV,hwwp=yes \
--wp-enable \
--wp-range=0x00c00000,0x00400000 \
--wp-status
$ head -c 16MiB </dev/urandom >/tmp/image.rom
./flashrom -p dummy:image=/tmp/image.rom,emulate=S25FL128L \
-c S25FL128L -E -V

Change-Id: Id573bc74e3bb46b7dc42f1452fff6394d4f091bc
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
---
M cli_classic.c
1 file changed, 406 insertions(+), 343 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/43/66343/8

To view, visit change 66343. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Id573bc74e3bb46b7dc42f1452fff6394d4f091bc
Gerrit-Change-Number: 66343
Gerrit-PatchSet: 8
Gerrit-Owner: Alexander Goncharov <chat@joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Felix Singer <felixsinger@posteo.net>
Gerrit-Attention: Felix Singer <felixsinger@posteo.net>
Gerrit-Attention: Thomas Heijligen <src@posteo.de>
Gerrit-Attention: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Attention: Alexander Goncharov <chat@joursoir.net>
Gerrit-MessageType: newpatchset