diff --git a/hb/set/set.py b/hb/set/set.py index 0351223dcc4560f42a46cc4e8955b644c723d3ff..7147b09542d0a0e14a9dcce4be7ac631d87f86f6 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):