Kevin Cheng | ee6030f | 2018-06-26 10:55:30 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # |
| 3 | # Copyright 2018 - The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | r"""Setup args. |
| 17 | |
| 18 | Defines the setup arg parser that holds setup specific args. |
| 19 | """ |
| 20 | |
| 21 | CMD_SETUP = "setup" |
| 22 | |
| 23 | |
| 24 | def GetSetupArgParser(subparser): |
| 25 | """Return the setup arg parser. |
| 26 | |
| 27 | Args: |
| 28 | subparser: argparse.ArgumentParser that is attached to main acloud cmd. |
| 29 | |
| 30 | Returns: |
| 31 | argparse.ArgumentParser with setup options defined. |
| 32 | """ |
| 33 | setup_parser = subparser.add_parser(CMD_SETUP) |
| 34 | setup_parser.required = False |
| 35 | setup_parser.set_defaults(which=CMD_SETUP) |
Sam Chiu | 81bdc65 | 2018-06-29 18:45:08 +0800 | [diff] [blame] | 36 | setup_parser.add_argument( |
| 37 | "--host", |
| 38 | action="store_true", |
| 39 | dest="host", |
| 40 | required=False, |
| 41 | help="Setup host to run local instance of an Android Virtual Device.") |
herbertxue | 34776bb | 2018-07-03 21:57:48 +0800 | [diff] [blame] | 42 | setup_parser.add_argument( |
| 43 | "--gcp_init", |
| 44 | action="store_true", |
| 45 | dest="gcp_init", |
| 46 | required=False, |
| 47 | help="Setup Google Cloud project name and enable required GCP APIs." |
| 48 | "Ex: Google Cloud Storage/ Internal Android Build/ Compute Engine") |
Kevin Cheng | 58b7e79 | 2018-10-05 02:26:53 -0700 | [diff] [blame] | 49 | setup_parser.add_argument( |
| 50 | "--force", |
| 51 | action="store_true", |
| 52 | dest="force", |
| 53 | required=False, |
| 54 | help="Force the setup steps even if it's not required.") |
| 55 | |
Kevin Cheng | ee6030f | 2018-06-26 10:55:30 -0700 | [diff] [blame] | 56 | return setup_parser |