提交 c74e19d2 编写于 作者: O openharmony_ci 提交者: Gitee

!166 【轻量级 PR】:Print the help information when no parameter set

Merge pull request !166 from pilipala195/N/A
......@@ -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.
先完成此消息的编辑!
想要评论请 注册