提交 54d1b277 编写于 作者: P pilipala195 提交者: Gitee

Print the help information when no parameter set

上级 9d70f9e6
......@@ -32,8 +32,8 @@ from hb.common.utils import OHOSException
def main():
parser = argparse.ArgumentParser(usage="hb",
description='OHOS build system')
parser = argparse.ArgumentParser(description='OHOS Build System '
f'version {VERSION}')
parser.add_argument('-v', '--version',
action='version',
version=f'[OHOS INFO] hb version {VERSION}')
......@@ -85,8 +85,11 @@ def main():
hb_error(exception.args[0])
status = -1
except Exception as exception:
hb_error(traceback.format_exc())
hb_error(f'Unhandled error: {exception}')
if not hasattr(args, 'command'):
parser.print_help()
else:
hb_error(traceback.format_exc())
hb_error(f'Unhandled error: {exception}')
status = -1
return status
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册