[Piglit] [PATCH] piglit: Print help instead of excepting if no arguments are given

Dylan Baker dylan at pnwbakers.com
Fri Aug 26 01:07:54 UTC 2016


Quoting Jordan Justen (2016-08-25 17:18:17)
> On 2016-08-25 11:34:57, Dylan Baker wrote:
> > This fixes a small bug that causes piglit to print an exception when
> > ./piglit is called with no arguments. It will, with this patch, print
> > the help message and exit.
> > 
> > Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> > ---
> >  piglit | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/piglit b/piglit
> > index 05fff14..14094a7 100755
> > --- a/piglit
> > +++ b/piglit
> > @@ -121,6 +121,9 @@ def main():
> >          input_ = sys.argv[1:]
> >  
> >      parser = argparse.ArgumentParser()
> > +    # This ugly little line just causes piglit to print the help message if
> > +    # ./piglit is run without any positional arguments
> > +    parser.set_defaults(func=lambda *_, **__: parser.print_help())
> 
> Not sure about the comment (I'd be fine to drop it), but:
> 
> Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
> 
> >      subparsers = parser.add_subparsers()
> >      print_cmd = subparsers.add_parser('print-cmd',
> >                                        add_help=False,
> > -- 
> > 2.9.3
> > 
> > _______________________________________________
> > Piglit mailing list
> > Piglit at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/piglit

Okay, I dropped the comment and pushed.

Thanks Jordan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160825/d0b6d90f/attachment.sig>


More information about the Piglit mailing list