diff options
author | Sadaf Ebrahimi <sadafebrahimi@google.com> | 2023-04-19 20:21:44 +0000 |
---|---|---|
committer | Sadaf Ebrahimi <sadafebrahimi@google.com> | 2023-04-19 20:35:45 +0000 |
commit | 904aac2b3e4e95cc5a05e1934c0333fa118a716d (patch) | |
tree | 2658c88ceba55e2bf3818398f7c54ff054ac25cb | |
parent | 6d25fe394a5bf4b8c6c510bbbd3e055196f819f4 (diff) | |
download | external_updater-904aac2b3e4e95cc5a05e1934c0333fa118a716d.tar.gz |
Rename parser arguments to fit command line convention
Test: TreeHugger
Change-Id: I1a7793fa87b00b2bb222c515148da3ea4d7d31c8
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | external_updater.py | 20 |
2 files changed, 14 insertions, 14 deletions
@@ -16,22 +16,22 @@ Update a library, commit, and upload the change to Gerrit: tools/external_updater/updater.sh update ${LIBNAME} ``` -Update a library without committing and uploading: +Update a library without committing and uploading to Gerrit: ```shell -tools/external_updater/updater.sh update --stop_after_merge ${LIBNAME} +tools/external_updater/updater.sh update --no-upload ${LIBNAME} ``` Update a library on top of the local changes in the current branch, commit, and upload the change to Gerrit: ```shell -tools/external_updater/updater.sh update --keep_local_changes ${LIBNAME} +tools/external_updater/updater.sh update --keep-local-changes ${LIBNAME} ``` Update a library without building: ```shell -tools/external_updater/updater.sh update --no_build ${LIBNAME} +tools/external_updater/updater.sh update --no-build ${LIBNAME} ``` LIBNAME can be the path to a library under external/, e.g. kotlinc, or diff --git a/external_updater.py b/external_updater.py index fe03390..149eea9 100644 --- a/external_updater.py +++ b/external_updater.py @@ -121,7 +121,7 @@ def _do_update(args: argparse.Namespace, updater: Updater, print("Build failed. Aborting upload.") return - if args.stop_after_merge: + if args.no_upload: return try: @@ -272,7 +272,7 @@ def parse_args() -> argparse.Namespace: nargs='*', help='Paths of the project. ' 'Relative paths will be resolved from external/.') - check_parser.add_argument('--json_output', + check_parser.add_argument('--json-output', help='Path of a json file to write result to.') check_parser.add_argument( '--all', @@ -292,7 +292,7 @@ def parse_args() -> argparse.Namespace: nargs='*', help='Paths of the project as globs. ' 'Relative paths will be resolved from external/.') - update_parser.add_argument('--json_output', + update_parser.add_argument('--json-output', help='Path of a json file to write result to.') update_parser.add_argument( '--force', @@ -303,23 +303,23 @@ def parse_args() -> argparse.Namespace: help='Run update and refresh to the current version.', action='store_true') update_parser.add_argument( - '--keep_date', + '--keep-date', help='Run update and do not change date in METADATA.', action='store_true') - update_parser.add_argument('--stop_after_merge', + update_parser.add_argument('--no-upload', action='store_true', - help='Stops after merging new changes') - update_parser.add_argument('--keep_local_changes', + help='Does not upload to Gerrit after upgrade') + update_parser.add_argument('--keep-local-changes', action='store_true', help='Updates the current branch') - update_parser.add_argument('--skip_post_update', + update_parser.add_argument('--skip-post-update', action='store_true', help='Skip post_update script') - update_parser.add_argument('--no_build', + update_parser.add_argument('--no-build', action='store_false', dest='build', help='Skip building'), - update_parser.add_argument('--remote_name', + update_parser.add_argument('--remote-name', default='aosp', required=False, help='Upstream remote name.') |