From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/8] core/pkg-utils: add a macro to pretty-print a help entry
Date: Thu, 10 Mar 2016 00:37:17 +0100 [thread overview]
Message-ID: <56E0B3AD.2040104@mind.be> (raw)
In-Reply-To: <3c47341f237bad2ed0c674c2ffe1def03a2bdb64.1457561521.git.yann.morin.1998@free.fr>
On 03/09/16 23:22, Yann E. MORIN wrote:
> To ensure that all the help entries we display are all formatted the
> same, we currently indent the help texts manually.
>
> Also, when a br2-external tree wants to display local custom help, they
> have to rely on a hard-coded layout (if they want to match our iwn
> output, which is not mandatory).
>
> Add a macro to pretty-print make rules in the help texts.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> Cc: J?r?me Pouiller <jezz@sysmic.org>
> Cc: Arnout Vandecappelle <arnout@mind.be>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> package/pkg-utils.mk | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
> index f88313a..873dbec 100644
> --- a/package/pkg-utils.mk
> +++ b/package/pkg-utils.mk
> @@ -104,6 +104,19 @@ define sep
>
> endef
>
> +# Pretty-print a make rule in the help text
> +#
> +# $(1): a list of double- or single-quoted string representing the rule
> +# and their help text, formatted as: "action : help for action"
> +# 'action' should be less than 22 characters, otherwise the help
> +# text will not be correctly indented.
> +#
> +define HELP_RULE
Most of our functions are lowercase. Perhaps print-help?
If we don't have the help-local indirection but directly do it in the
top-level help, then there's no need for an additional function.
Regards,
Arnout
> + for h in $(1); do \
> + printf " %-22s - %s\n" "$${h%% : *}" "$${h#* : }"; \
> + done
> +endef
> +
> # check-deprecated-variable -- throw an error on deprecated variables
> # example:
> # $(eval $(call check-deprecated-variable,FOO_MAKE_OPT,FOO_MAKE_OPTS))
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
next prev parent reply other threads:[~2016-03-09 23:37 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-09 22:22 [Buildroot] [PATCH 0/8] core: allow for custom, local help; rearrange package-specific help (branch yem/help) Yann E. MORIN
2016-03-09 22:22 ` [Buildroot] [PATCH 1/8] core: add the possibility to provide help for local, custom rules Yann E. MORIN
2016-03-09 23:35 ` Arnout Vandecappelle
2016-03-10 20:22 ` Yann E. MORIN
2016-03-11 0:01 ` Arnout Vandecappelle
2016-03-09 22:22 ` [Buildroot] [PATCH 2/8] core/pkg-utils: add a macro to pretty-print a help entry Yann E. MORIN
2016-03-09 23:37 ` Arnout Vandecappelle [this message]
2016-03-10 9:31 ` Jérôme Pouiller
2016-03-10 20:27 ` Yann E. MORIN
2016-03-10 20:24 ` Yann E. MORIN
2016-03-09 22:22 ` [Buildroot] [PATCH 3/8] core/pkg-generic: add help about package-specific rules Yann E. MORIN
2016-03-09 23:38 ` Arnout Vandecappelle
2016-03-09 22:22 ` [Buildroot] [PATCH 4/8] package/busybox: use the generic help rules Yann E. MORIN
2016-03-09 23:38 ` Arnout Vandecappelle
2016-03-09 22:22 ` [Buildroot] [PATCH 5/8] linux: add " Yann E. MORIN
2016-03-09 23:47 ` Arnout Vandecappelle
2016-03-10 9:21 ` Jérôme Pouiller
2016-03-10 9:39 ` Thomas Petazzoni
2016-03-10 9:52 ` Arnout Vandecappelle
2016-03-10 10:12 ` Thomas Petazzoni
2016-03-10 20:34 ` Yann E. MORIN
2016-03-10 20:58 ` Thomas Petazzoni
2016-03-10 20:29 ` Yann E. MORIN
2016-03-09 22:22 ` [Buildroot] [PATCH 6/8] package/uclibc: use " Yann E. MORIN
2016-03-09 23:47 ` Arnout Vandecappelle
2016-03-09 22:22 ` [Buildroot] [PATCH 7/8] boot/barebox: " Yann E. MORIN
2016-03-09 23:47 ` Arnout Vandecappelle
2016-03-09 22:22 ` [Buildroot] [PATCH 8/8] docs/manual: document the br2-external help-local Yann E. MORIN
2016-03-09 23:35 ` [Buildroot] [PATCH 0/8] core: allow for custom, local help; rearrange package-specific help (branch yem/help) Arnout Vandecappelle
2016-03-10 8:31 ` Thomas Petazzoni
2016-03-10 20:20 ` Yann E. MORIN
2016-03-10 21:01 ` Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56E0B3AD.2040104@mind.be \
--to=arnout@mind.be \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox