From: Petr Vorel <pvorel@suse.cz>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/2] tst_test.sh: Print environment variables in help
Date: Tue, 8 Feb 2022 18:52:27 +0100 [thread overview]
Message-ID: <YgKt20FFsWmNLPT/@pevik> (raw)
In-Reply-To: <YgJv2+y6v/+Tpb1N@yuki>
> Hi!
> > diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh
> > index 30614974c3..a7fd7b19c6 100644
> > --- a/testcases/lib/tst_test.sh
> > +++ b/testcases/lib/tst_test.sh
> > @@ -448,12 +448,30 @@ tst_usage()
> > if [ -n "$TST_USAGE" ]; then
> > $TST_USAGE
> > else
> > - echo "usage: $0"
> > - echo "OPTIONS"
> > + cat << EOF
> > +usage: $0
> > +
> > +Options
> > +-------
> > +EOF
> I think that the cat EOF syntax inside of else branch is a bit
> confusing, especially sice it prints just three lines of text...
Good point, I'll replace it with echo.
> But other than that:
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
How about dropping this?
echo "usage: $0"
(as a separate commit, I'd sent v2)
Because we don't support it in C API, is it really required to have it in shell.
I mean it's useful to show which options are mandatory or which cannot be
combined together etc. But in reality most of shell tests does not add it and
thus they are missing "OPTIONS" line (sure, I can add usage to them if you
think it's useful).
OTOH some tests have really complex setup, i.e.
testcases/network/netstress/netstress.c, that adding a support for usage string
would help them.
If you notice there were extra new lines (\n) to separate client and server side
to make help at least a bit readable, but Andrea removed them in 98af9ecf9e
("tst_test: Complete help message adding option before desc"):
git show --word-diff 98af9ecf9e334c07251f2f464191635f161a1603 testcases/network/netstress/netstress.c
These extra lines would not be needed when sort of usage added to C API.
I can add it, but I'm aware it's so minor, that I'm wasting a time of all of us.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2022-02-08 17:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 14:51 [LTP] [PATCH 0/2] shell API: print environment variables in .h Petr Vorel
2022-01-26 14:51 ` [LTP] [PATCH 1/2] tst_test.sh: Print environment variables in help Petr Vorel
2022-01-30 7:59 ` Li Wang
2022-02-08 13:27 ` Cyril Hrubis
2022-02-08 17:52 ` Petr Vorel [this message]
2022-03-14 14:14 ` Petr Vorel
2022-01-26 14:51 ` [LTP] [PATCH 2/2] doc: Mention places for environment variables Petr Vorel
2022-02-08 13:32 ` Cyril Hrubis
2022-01-26 15:13 ` [LTP] [PATCH 0/2] shell API: print environment variables in .h Petr Vorel
2022-01-30 4:03 ` xuyang2018.jy
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=YgKt20FFsWmNLPT/@pevik \
--to=pvorel@suse.cz \
--cc=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/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