[U-Boot] [PATCH v3 0/7] tools: env: simplify argument parsing

Andreas Fenkart andreas.fenkart at digitalstrom.com
Wed Dec 9 13:13:20 CET 2015


Currently parameter parsing happens in two steps. First with 
getopt at the beginning of main to parse the common options.
Then second is using adhoc parsing in printenv/setenv code path.
When doing adhoc parsing, 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.

v3:
- rebased on top of master/8555dd8
- made emails in From:/Signed-off header match

Andreas Fenkart (7):
  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
  tools: env: factor out parse_common_args
  tools: env: update usage strings

 common/env_flags.c      |  14 +--
 include/env_flags.h     |   2 +-
 tools/env/fw_env.c      | 127 ++++++------------------
 tools/env/fw_env.h      |  24 +++++
 tools/env/fw_env_main.c | 249 ++++++++++++++++++++++++++++++++++--------------
 5 files changed, 239 insertions(+), 177 deletions(-)

-- 
2.6.2



More information about the U-Boot mailing list