[fidldev] Print help text when no args provided
I thought the command was broken because I was getting a python error
when I called it with no arguments. I would instead expect the help
text (added by this CL).
Change-Id: I8e168bdf35c86c002c9118fe33f3d251416e5234
Reviewed-on: https://fuchsia-review.googlesource.com/c/fidl-misc/+/413909
Reviewed-by: Felix Zhu <fcz@google.com>
diff --git a/fidldev/fidldev.py b/fidldev/fidldev.py
index edd9bef..053334e 100755
--- a/fidldev/fidldev.py
+++ b/fidldev/fidldev.py
@@ -175,4 +175,10 @@
if __name__ == '__main__':
args = parser.parse_args()
+ try:
+ func = args.func
+ except AttributeError:
+ parser.print_help(sys.stderr)
+ sys.exit(1)
+ func(args)
args.func(args)