[Dctrl-tools-devel] Bug#525525: Bug#525525: [PATCH] grep-dctrl: add --compact option

Antti-Juhani Kaijanaho antti-juhani at kaijanaho.fi
Thu Nov 3 16:42:36 UTC 2011


On Thu, Nov 03, 2011 at 11:57:32AM -0400, Jeff King wrote:
> Subject: [PATCH] grep-dctrl: add --compact option
> 
> When only one field is being shown, grep-dctrl's original
> behavior was to "compact" the output to remove the
> empty-line stanza separator. This made the output more
> pleasant for a human viewer, but inconsistent with the
> multiple-field case for machine parsing.
> 
> Version 2.19 made things more consistent by unconditionally
> showing the stanza separator. This patch adds a --compact
> flag which lets human viewers restore the old behavior.

> +                        if (!args.compact || args.num_show_fields > 1)

Is there any reason to maintain the second clause?  If you're explicitly
selecting --compact, might you perhaps be interested in a no-separator output
for a multiple-field case as well?

(Also, I can see this option seeing use with scripts too.  See #646189.)

Otherwise this looks good.  Could you add manpage changes as well?

-- 
Antti-Juhani Kaijanaho, Jyväskylä, Finland
http://antti-juhani.kaijanaho.fi/newblog/
http://www.flickr.com/photos/antti-juhani/






More information about the Dctrl-tools-devel mailing list