From: Ruediger Meier <sweet_f_a@gmx.de>
To: J William Piggott <elseifthen@gmx.com>
Cc: Karel Zak <kzak@redhat.com>, util-linux@vger.kernel.org
Subject: Re: [PATCH 04/12] hwclock: add usage() functions heading
Date: Wed, 21 Jun 2017 14:21:11 +0200 [thread overview]
Message-ID: <201706211421.12132.sweet_f_a@gmx.de> (raw)
In-Reply-To: <68a54120-d8ad-59c2-89b6-4ccdd961300b@gmx.com>
On Monday 19 June 2017, J William Piggott wrote:
> Make a functions heading, similar to the existing options heading.
>
> * include/c.h: define USAGE_FUNCTIONS
> * Documentation/boilerplate.c: add USAGE_FUNCTIONS
> * sys-utils/hwclock.c add functions header to usage()
>
> Signed-off-by: J William Piggott <elseifthen@gmx.com>
> ---
> Documentation/boilerplate.c | 3 +++
> include/c.h | 3 ++-
> sys-utils/hwclock.c | 3 +--
> 3 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/boilerplate.c
> b/Documentation/boilerplate.c index 7da9374..057893b 100644
> --- a/Documentation/boilerplate.c
> +++ b/Documentation/boilerplate.c
> @@ -33,6 +33,9 @@ static void __attribute__((__noreturn__))
> usage(FILE *out) {
> fputs(USAGE_HEADER, out);
> fprintf(out, _(" %s [options] file...\n"),
> program_invocation_short_name); + fputs(USAGE_FUNCTIONS, out);
> + fputs(_(" -s, --do-something some specific task\n"), out);
> + fputs(_(" -o, --do-other some different task\n"), out);
These options -s and -o are not implemented in the boilerplate.c. Also
the short usage line does not mention "functions" but "options" only.
I think this USAGE_FUNCTIONS looks quite good in hwclock and would be
nice for some other commands too. But I guess 90% of all commands do
not need this. So maybe we should not add this to the boilerplate.
cu,
Rudi
> fputs(USAGE_OPTIONS, out);
> fputs(_(" -n, --no-argument option does not use argument\n"),
> out); fputs(_(" --optional[=<arg>] option argument is
> optional\n"), out); diff --git a/include/c.h b/include/c.h
> index a5162b9..9c19965 100644
> --- a/include/c.h
> +++ b/include/c.h
> @@ -317,10 +317,11 @@ static inline int xusleep(useconds_t usec)
> */
> #define USAGE_HEADER _("\nUsage:\n")
> #define USAGE_OPTIONS _("\nOptions:\n")
> +#define USAGE_FUNCTIONS _("\nFunctions:\n")
> #define USAGE_SEPARATOR "\n"
> #define USAGE_HELP _(" -h, --help display this help and
> exit\n") #define USAGE_VERSION _(" -V, --version output version
> information and exit\n") -#define USAGE_MAN_TAIL(_man) _("\nFor
> more details see %s.\n"), _man +#define USAGE_MAN_TAIL(_man)
> _("\nFor more details see %s\n"), _man
>
> #define UTIL_LINUX_VERSION _("%s from %s\n"),
> program_invocation_short_name, PACKAGE_STRING
>
> diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
> index 28655b0..9d6bb11 100644
> --- a/sys-utils/hwclock.c
> +++ b/sys-utils/hwclock.c
> @@ -1208,8 +1208,7 @@ usage(const struct hwclock_control *ctl, FILE
> *out) fputs(USAGE_SEPARATOR, out);
> fputs(_(" Query or set the hardware clock\n"), out);
>
> - fputs(USAGE_SEPARATOR, out);
> - fputs(_("Functions:\n"), out);
> + fputs(USAGE_FUNCTIONS, out);
> fputs(_(" -r, --show read hardware clock and print
> result\n" " --get read hardware clock and print drift
> corrected result\n" " --set set the RTC to the time
> given with --date\n"), out); --
> To unsubscribe from this list: send the line "unsubscribe util-linux"
> in the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-06-21 12:21 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-19 0:35 [PATCH 00/12] pull request J William Piggott
2017-06-19 0:37 ` [PATCH 01/12] hwclock: remove dead code in usage() J William Piggott
2017-06-19 0:38 ` [PATCH 02/12] hwclock: update usage() to util-linux style J William Piggott
2017-06-19 0:40 ` [PATCH 03/12] hwclock: update usage() FILE name J William Piggott
2017-06-19 0:41 ` [PATCH 04/12] hwclock: add usage() functions heading J William Piggott
2017-06-20 8:36 ` Karel Zak
2017-06-21 0:59 ` J William Piggott
2017-06-21 12:21 ` Ruediger Meier [this message]
2017-06-21 15:59 ` J William Piggott
2017-06-19 0:42 ` [PATCH 05/12] include: update pathnames.h J William Piggott
2017-06-20 8:44 ` Karel Zak
2017-06-21 0:53 ` J William Piggott
2017-06-19 0:44 ` [PATCH 06/12] hwclock: use RTC in help output J William Piggott
2017-06-19 0:45 ` [PATCH 07/12] hwclock: update --help content and grammar J William Piggott
2017-06-20 8:51 ` Karel Zak
2017-06-21 0:53 ` J William Piggott
2017-06-21 13:05 ` Ruediger Meier
2017-06-21 14:55 ` Karel Zak
2017-06-21 15:30 ` J William Piggott
2017-06-22 2:04 ` Ruediger Meier
2017-06-22 18:46 ` J William Piggott
2017-06-21 15:01 ` Karel Zak
2017-06-21 17:02 ` J William Piggott
2017-06-19 0:46 ` [PATCH 08/12] hwclock: slice up the usage text J William Piggott
2017-06-19 0:47 ` [PATCH 09/12] hwclock: add --update-drift check J William Piggott
2017-06-19 0:48 ` [PATCH 10/12] Docs: update howto-usage-function.txt J William Piggott
2017-06-19 0:49 ` [PATCH 11/12] hwclock: remove unused usage() FILE argument J William Piggott
2017-06-20 8:56 ` Karel Zak
2017-06-21 0:52 ` J William Piggott
2017-06-28 19:29 ` fputs() vs puts() (was: [PATCH] hwclock: remove unused usage() FILE argument) Ruediger Meier
2017-06-29 8:51 ` Karel Zak
2017-06-29 10:37 ` Ruediger Meier
2017-06-29 10:53 ` Karel Zak
2017-06-29 14:46 ` fputs() vs puts() J William Piggott
2017-06-29 20:12 ` Karel Zak
2017-06-30 18:29 ` J William Piggott
2017-07-03 8:30 ` Ruediger Meier
2017-07-03 12:07 ` Karel Zak
2017-07-03 12:38 ` Ruediger Meier
2017-07-03 14:25 ` Karel Zak
2017-07-03 15:09 ` Bernhard Voelker
2017-07-03 15:15 ` Bernhard Voelker
2017-06-29 10:37 ` fputs() vs puts() (was: [PATCH] hwclock: remove unused usage() FILE argument) Karel Zak
2017-06-21 9:26 ` [PATCH 11/12] hwclock: remove unused usage() FILE argument Karel Zak
2017-06-21 15:48 ` J William Piggott
2017-06-25 21:39 ` J William Piggott
2017-06-19 0:51 ` [PATCH 12/12] hwclock: remove unused stdarg.h J William Piggott
2017-06-21 9:27 ` [PATCH 00/12] pull request Karel Zak
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=201706211421.12132.sweet_f_a@gmx.de \
--to=sweet_f_a@gmx.de \
--cc=elseifthen@gmx.com \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).