testrun.sh: Improve --help message

Message ID 20210503212206.1699908-1-lamm@linux.ibm.com
State Committed
Commit 709e3709a02636fb9ce79fad727b09140989864c
Delegated to: Carlos O'Donell
Headers
Series testrun.sh: Improve --help message |

Commit Message

Lucas A. M. Magalhaes May 3, 2021, 9:22 p.m. UTC
  The testrun.sh --help message was missing the "container" option.
Besides just adding the missing option I decide to rewrite it in the
same layout as other tools.
---
 Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
  

Comments

Carlos O'Donell May 10, 2021, 1:39 p.m. UTC | #1
On 5/3/21 5:22 PM, Lucas A. M. Magalhaes via Libc-alpha wrote:
> The testrun.sh --help message was missing the "container" option.
> Besides just adding the missing option I decide to rewrite it in the
> same layout as other tools.

LGTM.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  Makefile | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 50f99ca611..242d36de91 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -144,8 +144,13 @@ builddir=`dirname "$$0"`
>  GCONV_PATH="$${builddir}/iconvdata"
>  
>  usage () {
> -  echo "usage: $$0 [--tool=strace] PROGRAM [ARGUMENTS...]" 2>&1
> -  echo "       $$0 --tool=valgrind PROGRAM [ARGUMENTS...]" 2>&1
> +cat << EOF
> +Usage: $$0 [OPTIONS] <program> [ARGUMENTS...]
> +
> +  --tool=TOOL  Run with the specified TOOL. It can be strace, valgrind or
> +               container. The container will run within support/test-container.
> +EOF
> +
>    exit 1
>  }
>  
>
  
Lucas A. M. Magalhaes May 11, 2021, 12:19 p.m. UTC | #2
Hi Carlos. Can you push this for me?

Quoting Carlos O'Donell (2021-05-10 10:39:57)
> On 5/3/21 5:22 PM, Lucas A. M. Magalhaes via Libc-alpha wrote:
> > The testrun.sh --help message was missing the "container" option.
> > Besides just adding the missing option I decide to rewrite it in the
> > same layout as other tools.
> 
> LGTM.
> 
> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
> 
> > ---
> >  Makefile | 9 +++++++--
> >  1 file changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/Makefile b/Makefile
> > index 50f99ca611..242d36de91 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -144,8 +144,13 @@ builddir=`dirname "$$0"`
> >  GCONV_PATH="$${builddir}/iconvdata"
> >  
> >  usage () {
> > -  echo "usage: $$0 [--tool=strace] PROGRAM [ARGUMENTS...]" 2>&1
> > -  echo "       $$0 --tool=valgrind PROGRAM [ARGUMENTS...]" 2>&1
> > +cat << EOF
> > +Usage: $$0 [OPTIONS] <program> [ARGUMENTS...]
> > +
> > +  --tool=TOOL  Run with the specified TOOL. It can be strace, valgrind or
> > +               container. The container will run within support/test-container.
> > +EOF
> > +
> >    exit 1
> >  }
> >  
> > 
> 
> 
> -- 
> Cheers,
> Carlos.
>
  
Siddhesh Poyarekar May 25, 2021, 4:52 a.m. UTC | #3
On 5/11/21 5:49 PM, Lucas A. M. Magalhaes via Libc-alpha wrote:
> Hi Carlos. Can you push this for me?
> 

I've pushed this now.

Siddhesh
  

Patch

diff --git a/Makefile b/Makefile
index 50f99ca611..242d36de91 100644
--- a/Makefile
+++ b/Makefile
@@ -144,8 +144,13 @@  builddir=`dirname "$$0"`
 GCONV_PATH="$${builddir}/iconvdata"
 
 usage () {
-  echo "usage: $$0 [--tool=strace] PROGRAM [ARGUMENTS...]" 2>&1
-  echo "       $$0 --tool=valgrind PROGRAM [ARGUMENTS...]" 2>&1
+cat << EOF
+Usage: $$0 [OPTIONS] <program> [ARGUMENTS...]
+
+  --tool=TOOL  Run with the specified TOOL. It can be strace, valgrind or
+               container. The container will run within support/test-container.
+EOF
+
   exit 1
 }