Skip to content

tools: env: simplify argument parsing

Michael Heimpold u-boot 1 version New

Get series with b4
b4 am 10422451.SNlxWfdyyk@kerker

Versions newest first

  1. v1 Latest0 of 5 patches 0 repliesNew

Patches in v1 No applies recorded yet

None of the 5 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [U-Boot] [PATCH 0/5] tools: env: simplify argument parsing

Hi Andreas,

Am Tuesday 24 November 2015, 14:21:10 schrieb Andreas Fenkart:

Quoted 3 lines

I want to add -c config_file parameter to fw_setenv/fw_printenv, so I can switch between old/new u-boot environment after u-boot upgrade.

for a similar use-case a patch was accepted/merged some days ago:
http://git.denx.de/?p=u-boot.git;a=commit;h=9884f44cab5d1ce944b1dc087c9bb8db0efb5160

This is why you series does not apply to current master branch.

Quoted 6 lines

In it's current state paramter parsing is quite hard to understand since it happens in two places. One is using getopt at the beginning of main, the second is using adhoc parsing where the order of arguments is important.
This patch will parse arguments only in one place using getopt and store the parsed flags in a global struct.

It would be desirable, if you could rebase and respin your series, since it is much appreciated.

Best regards,
Michael

Quoted 14 lines

Andreas Fenkart (5):
tools: env validate: pass values as 0-based array
tools: env: make parse_aes_key stateless
tools: env: introduce setenv/printenv argument structs
tools: env: parse aes key / suppress flag into argument struct
tools: env: shift optind arguments and fix argument indices

 common/env_flags.c      |  14 +++---
 include/env_flags.h     |   2 +-
 tools/env/fw_env.c      |  94 ++++++++++--------------------------
 tools/env/fw_env.h      |  21 ++++++++
 tools/env/fw_env_main.c | 124 +++++++++++++++++++++++++++++++++---------------
5 files changed, 140 insertions(+), 115 deletions(-)