devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10 v2] usage()/--help clean up & unification
@ 2013-04-10 18:29 Mike Frysinger
       [not found] ` <1365618555-5893-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Mike Frysinger @ 2013-04-10 18:29 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

Each utility currently open codes how they process options and
implement usage().  This leads to inconsistent behavior and output
which sucks.  A bunch also get common things wrong (like sending
--help to stderr).

Rather than go through them one by one and fix their bugs, start
a new mini framework in the util.[ch] code base.  This allows the
utils to be much more data driven in their approach to options --
they declare certain structures with the right format, and then
call usage() as needed.  The new util code takes care of the rest.

I also snuck in a few minor fixes in this patch series that I
noticed as I was hacking on things.  Really I just wanted a --scan
option in the fdtdump tool :).

For the v2 series, I fixed a compile/output bug in one of the
patches and this now passes `make check`.  I also added a --debug
option to fdtdump.

Mike Frysinger (10):
  utilfdt_read_err: use xmalloc funcs
  utilfdt_read: pass back up the length of data read
  die: constify format string arg
  util_version: new helper for displaying version info
  fdtdump: make usage a bit more friendly
  fdtdump: add a --scan option
  dtc/fdt{get,put}/convert-dtsv0-lexer: convert to new usage helpers
  util: drop "long" from usage helpers
  util: add common ARRAY_SIZE define
  fdtdump: add a debug mode

 convert-dtsv0-lexer.l |  24 +++++++----
 dtc.c                 | 116 +++++++++++++++++++++++++-------------------------
 dtc.h                 |   1 -
 fdtdump.c             | 109 ++++++++++++++++++++++++++++++++++++++++++-----
 fdtget.c              |  62 ++++++++++++---------------
 fdtput.c              |  65 +++++++++++++---------------
 tests/testutils.c     |   2 +-
 util.c                |  73 ++++++++++++++++++++++++++++---
 util.h                |  78 +++++++++++++++++++++++++++++++--
 9 files changed, 375 insertions(+), 155 deletions(-)

-- 
1.8.1.2

^ permalink raw reply	[flat|nested] 24+ messages in thread
* [PATCH 00/10 v3] usage()/--help clean up & unification, and extend fdtdump
@ 2013-04-16  2:13 Mike Frysinger
       [not found] ` <1366078397-14889-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 24+ messages in thread
From: Mike Frysinger @ 2013-04-16  2:13 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

Each utility currently open codes how they process options and
implement usage().  This leads to inconsistent behavior and output
which sucks.  A bunch also get common things wrong (like sending
--help to stderr).

Rather than go through them one by one and fix their bugs, start
a new mini framework in the util.[ch] code base.  This allows the
utils to be much more data driven in their approach to options --
they declare certain structures with the right format, and then
call usage() as needed.  The new util code takes care of the rest.

I also snuck in a few minor fixes in this patch series that I
noticed as I was hacking on things.  Really I just wanted --scan
and --debug options in the fdtdump tool :).

I've made sure each patch builds & passes `make check` by itself.
So things should be git bisectable.

For the v3 series:
 - add dedicated _len read helpers rather than rework existing ones
 - rename dprintf() to dumpf() in fdtdump

Mike Frysinger (10):
  utilfdt_read_err: use xmalloc funcs
  utilfdt_read: pass back up the length of data read
  die: constify format string arg
  util_version: new helper for displaying version info
  fdtdump: make usage a bit more friendly
  fdtdump: add a --scan option
  dtc/fdt{get,put}/convert-dtsv0-lexer: convert to new usage helpers
  util: drop "long" from usage helpers
  util: add common ARRAY_SIZE define
  fdtdump: add a debug mode

 convert-dtsv0-lexer.l |  24 +++++++----
 dtc.c                 | 116 +++++++++++++++++++++++++-------------------------
 dtc.h                 |   1 -
 fdtdump.c             | 110 ++++++++++++++++++++++++++++++++++++++++++-----
 fdtget.c              |  60 ++++++++++++--------------
 fdtput.c              |  63 +++++++++++++--------------
 util.c                |  84 +++++++++++++++++++++++++++++++++---
 util.h                |  85 +++++++++++++++++++++++++++++++++++-
 8 files changed, 393 insertions(+), 150 deletions(-)

-- 
1.8.1.2

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2013-04-30  8:23 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-10 18:29 [PATCH 00/10 v2] usage()/--help clean up & unification Mike Frysinger
     [not found] ` <1365618555-5893-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-10 18:29   ` [PATCH 01/10] utilfdt_read_err: use xmalloc funcs Mike Frysinger
2013-04-10 18:29   ` [PATCH 02/10] utilfdt_read: pass back up the length of data read Mike Frysinger
     [not found]     ` <1365618555-5893-3-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-15  4:58       ` David Gibson
     [not found]         ` <20130415045838.GI16400-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2013-04-15 23:22           ` Mike Frysinger
2013-04-10 18:29   ` [PATCH 03/10] die: constify format string arg Mike Frysinger
2013-04-10 18:29   ` [PATCH 04/10] util_version: new helper for displaying version info Mike Frysinger
2013-04-10 18:29   ` [PATCH 05/10] fdtdump: make usage a bit more friendly Mike Frysinger
     [not found]     ` <1365618555-5893-6-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-11  4:00       ` David Gibson
     [not found]         ` <20130411040014.GA8165-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2013-04-11 16:31           ` Mike Frysinger
2013-04-10 18:29   ` [PATCH 06/10] fdtdump: add a --scan option Mike Frysinger
     [not found]     ` <1365618555-5893-7-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-11  4:11       ` David Gibson
     [not found]         ` <20130411041130.GB8165-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2013-04-11 22:44           ` Mike Frysinger
     [not found]             ` <201304111844.21667.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-15  5:02               ` David Gibson
2013-04-10 18:29   ` [PATCH 07/10] dtc/fdt{get, put}/convert-dtsv0-lexer: convert to new usage helpers Mike Frysinger
2013-04-10 18:29   ` [PATCH 08/10] util: drop "long" from " Mike Frysinger
2013-04-10 18:29   ` [PATCH 09/10] util: add common ARRAY_SIZE define Mike Frysinger
     [not found]     ` <1365618555-5893-10-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-11  4:12       ` David Gibson
2013-04-10 18:29   ` [PATCH 10/10] fdtdump: add a debug mode Mike Frysinger
     [not found]     ` <1365618555-5893-11-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-15  5:12       ` David Gibson
     [not found]         ` <20130415051206.GK16400-W9XWwYn+TF0XU02nzanrWNbf9cGiqdzd@public.gmane.org>
2013-04-15 23:35           ` Mike Frysinger
     [not found]             ` <201304151935.56128.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-15 23:53               ` David Gibson
  -- strict thread matches above, loose matches on Subject: below --
2013-04-16  2:13 [PATCH 00/10 v3] usage()/--help clean up & unification, and extend fdtdump Mike Frysinger
     [not found] ` <1366078397-14889-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-16  2:13   ` [PATCH 07/10] dtc/fdt{get, put}/convert-dtsv0-lexer: convert to new usage helpers Mike Frysinger
     [not found]     ` <1366078397-14889-8-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-30  8:23       ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).