Re: [PATCH 2/3] generate-cmdlist.sh: parse common group commands
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- May 8, 2015, 03:39 UTC
- Message-ID
- <CAPig+cR67f02F0q7ZjPFG4V-EdtSgmnxs2BLqzH1TwfhcObR1A@mail.gmail.com>
- In-Reply-To
- <20150508032011.GA10209@flurp.local>
On Thu, May 7, 2015 at 11:20 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 17 quoted lines
> From: Eric Sunshine <sunshine@sunshineco.com>
> Subject: [PATCH] generate-cmdlist: parse common group commands
>
> Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
> ---
> diff --git a/generate-cmdlist.awk b/generate-cmdlist.awk
> new file mode 100644
> index 0000000..19b36e5
> --- /dev/null
> +++ b/generate-cmdlist.awk
> @@ -0,0 +1,39 @@
> [...]
> +state == 1 {
> + grp[$1] = ++n
> + sub($1"[ ][ ]*", "")
> + printf "\tN_(\"%s\"),\n", $0
> + nextBy the way, this 'next' line can be deleted. It was leftover gunk from an earlier iteration. It doesn't harm, but doesn't help either, and is thus potentially confusing.
Show 5 quoted lines
> +}
> +/\[common\]/ {
> + state = 1
> +}
> +END { print "};" }