Skip to content
Snippets Groups Projects
Verified Commit c5ac82e8 authored by Davide Gardenal's avatar Davide Gardenal
Browse files

upgrade_oniro: convert required options


Convert required options to positional arguments.
Required options are not a good idea because it can be
confusing for the user have an option (that should be
optional) required for running the script.

Signed-off-by: Davide Gardenal's avatarDavide Gardenal <davide.gardenal@huawei.com>
parent 7307ee9f
No related branches found
No related tags found
No related merge requests found
...@@ -59,9 +59,9 @@ def init_script_options(): ...@@ -59,9 +59,9 @@ def init_script_options():
parser = argparse.ArgumentParser(description=script_description) parser = argparse.ArgumentParser(description=script_description)
# TODO a choice could be added in the version by checking all the tags of Oniro # TODO a choice could be added in the version by checking all the tags of Oniro
parser.add_argument("-tv", "--target-version", type=str, required=True, parser.add_argument("target-version", type=str,
help="Specify the target version of Oniro you want to upgrade to") help="Specify the target version of Oniro you want to upgrade to")
parser.add_argument("-d", "--build-directory", type=pathlib.Path, required=True, parser.add_argument("build-directory", type=pathlib.Path,
help="Path to the build directory you want to use (can be non-existent)") help="Path to the build directory you want to use (can be non-existent)")
# TODO a choice could be added in the machine # TODO a choice could be added in the machine
parser.add_argument("-m", "--machine", type=str, default="qemux86-64", parser.add_argument("-m", "--machine", type=str, default="qemux86-64",
...@@ -79,8 +79,8 @@ def init_script_options(): ...@@ -79,8 +79,8 @@ def init_script_options():
parsed_args = vars(parser.parse_args()) parsed_args = vars(parser.parse_args())
global target_version, build_directory, machine, flavour, image, conf_directory global target_version, build_directory, machine, flavour, image, conf_directory
target_version = parsed_args["target_version"] target_version = parsed_args["target-version"]
build_directory = parsed_args["build_directory"] build_directory = parsed_args["build-directory"]
machine = parsed_args["machine"] machine = parsed_args["machine"]
flavour = parsed_args["flavour"] flavour = parsed_args["flavour"]
image = parsed_args["image"] image = parsed_args["image"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment