This actually fixes the help message for the piglit command, but doesn't
break using other commands, like the last patch.

Signed-off-by: Dylan Baker <[email protected]>
CC: [email protected]
---
 piglit | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/piglit b/piglit
index 05fff14..4ce6c41 100755
--- a/piglit
+++ b/piglit
@@ -162,7 +162,11 @@ def main():
     # example), and then pass the arguments that this parser doesn't know about
     # to that executable
     parsed, args = parser.parse_known_args(input_)
-    returncode = parsed.func(args)
+    try:
+        returncode = parsed.func(args)
+    except AttributeError:
+        parser.print_help()
+        sys.exit(1)
     sys.exit(returncode)
 
 
-- 
2.9.3

_______________________________________________
Piglit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to