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

upgrade_oniro.py: add global script options


Add global script options.
Change function name arg_parsing -> init_script_options to reflect
better the behevior of the function.

Signed-off-by: Davide Gardenal's avatarDavide Gardenal <davide.gardenal@huawei.com>
parent 87c0fe6d
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,15 @@ import pathlib ...@@ -46,7 +46,15 @@ import pathlib
script_description = "[WIP] A tool to upgrade to a newer version of Oniro" script_description = "[WIP] A tool to upgrade to a newer version of Oniro"
def arg_parsing(): # Script options
target_version = ""
build_directory = pathlib.Path()
machine = ""
flavour = ""
image = ""
conf_directory = pathlib.Path()
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
...@@ -68,7 +76,14 @@ def arg_parsing(): ...@@ -68,7 +76,14 @@ def arg_parsing():
help="Path to the config directory you want to use. If omitted the default configs will be use.") help="Path to the config directory you want to use. If omitted the default configs will be use.")
return parser.parse_args() parsed_args = vars(parser.parse_args())
global target_version, build_directory, machine, flavour, image, conf_directory
target_version = parsed_args["target_version"]
build_directory = parsed_args["build_directory"]
machine = parsed_args["machine"]
flavour = parsed_args["flavour"]
image = parsed_args["image"]
conf_directory = parsed_args["conf_directory"]
if __name__ == "__main__": if __name__ == "__main__":
print(arg_parsing()) init_script_options()
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