diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2011-12-25 09:12:16 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2011-12-25 09:12:16 +0000 |
commit | cf3abbf99f950681e9601a1da17c0709179ce76e (patch) | |
tree | 20ffb99db71ee422b2196d82742fdc2197ab40e7 /cli_classic.c | |
parent | 1d48e3c657dd2ad26bfa38d8a43766529997c0fa (diff) | |
download | flashrom-cf3abbf99f950681e9601a1da17c0709179ce76e.tar.gz |
Add deferred --image processing
The general idea and most of the code are based on the following
commits in the chromiumos flashrom tree:
8fc0740356ca15d02fb1c65ab43b10844f148c3b
bb9049c66ca55e0dc621dd2c70b5d2cb6e5179bf
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
and the main part:
d0ea9ed71e7f86bb8e8db2ca7c32a96de25343d8
Signed-off-by: David Hendricks <dhendrix@chromium.org>
This implementation does not defer the processing until doit(), but after the
argument parsing loop only (doit() should not contain argument checks).
This allows to specify -i and -l parameters in any order.
Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at>
Acked-by: David Hendricks <dhendrix@google.com>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1482 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'cli_classic.c')
-rw-r--r-- | cli_classic.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/cli_classic.c b/cli_classic.c index a931de8..3928ded 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -295,14 +295,9 @@ int main(int argc, char *argv[]) cli_classic_abort_usage(); break; case 'i': - /* FIXME: -l has to be specified before -i. */ tempstr = strdup(optarg); - if (find_romentry(tempstr) < 0) { - fprintf(stderr, "Error: image %s not found in " - "layout file or -i specified before " - "-l\n", tempstr); + if (register_include_arg(tempstr)) cli_classic_abort_usage(); - } break; case 'L': if (++operation_specified > 1) { @@ -395,6 +390,9 @@ int main(int argc, char *argv[]) cli_classic_abort_usage(); } + if (process_include_args()) + cli_classic_abort_usage(); + /* FIXME: Print the actions flashrom will take. */ if (list_supported) { |