From 3c0f013e04925d2c251e0b28b31ba08b69e64abc Mon Sep 17 00:00:00 2001 From: weberfeng <861080039@qq.com> Date: Fri, 4 Jun 2021 08:16:14 -0400 Subject: [PATCH] fix: support hb set -p parameter hb set example: hb set -p ipcamera_hispark_taurus@hisilicon Signed-off-by: weberfeng <861080039@qq.com> --- hb/set/set.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/hb/set/set.py b/hb/set/set.py index 0351223..7147b09 100755 --- a/hb/set/set.py +++ b/hb/set/set.py @@ -30,18 +30,23 @@ def add_options(parser): default=None, help='Set OHOS root path') parser.add_argument('-p', '--product', - action='store_true', - help='Set OHOS board and kernel') + nargs=1, + default=[], + help='Set product with {product_name}@{company}, \ + eg: ipcamera_hispark_taurus@hisilicon') def exec_command(args): + root_path = None + product = None + company = None if args.root_path is not None: - return set_root_path(root_path=args.root_path) + root_path = args.root_path + if len(args.product): + product, company = args.product[0].split('@') - if args.product: - return set_product() - - return set_root_path() == 0 and set_product() == 0 + return set_root_path(root_path=root_path) == 0 \ + and set_product(product_name=product, company=company) == 0 def set_root_path(root_path=None): -- Gitee