devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] usage()/--help clean up & unification
@ 2013-04-08  7:06 Mike Frysinger
       [not found] ` <1365404812-15153-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Mike Frysinger @ 2013-04-08  7:06 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 :).

Mike Frysinger (8):
  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

 convert-dtsv0-lexer.l |  22 +++++++---
 dtc.c                 | 116 +++++++++++++++++++++++++-------------------------
 fdtdump.c             |  72 +++++++++++++++++++++++++++----
 fdtget.c              |  62 ++++++++++++---------------
 fdtput.c              |  65 +++++++++++++---------------
 util.c                |  72 ++++++++++++++++++++++++++++---
 util.h                |  76 +++++++++++++++++++++++++++++++--
 7 files changed, 336 insertions(+), 149 deletions(-)

-- 
1.8.1.2

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

end of thread, other threads:[~2013-04-09  0:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-08  7:06 [PATCH 0/8] usage()/--help clean up & unification Mike Frysinger
     [not found] ` <1365404812-15153-1-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-08  7:06   ` [PATCH 1/8] utilfdt_read_err: use xmalloc funcs Mike Frysinger
     [not found]     ` <1365404812-15153-2-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-08  9:42       ` David Gibson
2013-04-08  7:06   ` [PATCH 2/8] utilfdt_read: pass back up the length of data read Mike Frysinger
2013-04-08  7:06   ` [PATCH 3/8] die: constify format string arg Mike Frysinger
     [not found]     ` <1365404812-15153-4-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-08  9:43       ` David Gibson
2013-04-08  7:06   ` [PATCH 4/8] util_version: new helper for displaying version info Mike Frysinger
     [not found]     ` <1365404812-15153-5-git-send-email-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2013-04-09  0:01       ` David Gibson
2013-04-08  7:06   ` [PATCH 5/8] fdtdump: make usage a bit more friendly Mike Frysinger
2013-04-08  7:06   ` [PATCH 6/8] fdtdump: add a --scan option Mike Frysinger
2013-04-08  7:06   ` [PATCH 7/8] dtc/fdt{get, put}/convert-dtsv0-lexer: convert to new usage helpers Mike Frysinger
2013-04-08  7:06   ` [PATCH 8/8] util: drop "long" from " Mike Frysinger
2013-04-08  8:53   ` [PATCH 0/8] usage()/--help clean up & unification Mike Frysinger

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).