1*800a58d9SAndroid Build Coastguard Worker# Copyright 2018 - The Android Open Source Project 2*800a58d9SAndroid Build Coastguard Worker# 3*800a58d9SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 4*800a58d9SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 5*800a58d9SAndroid Build Coastguard Worker# You may obtain a copy of the License at 6*800a58d9SAndroid Build Coastguard Worker# 7*800a58d9SAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 8*800a58d9SAndroid Build Coastguard Worker# 9*800a58d9SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 10*800a58d9SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 11*800a58d9SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*800a58d9SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 13*800a58d9SAndroid Build Coastguard Worker# limitations under the License. 14*800a58d9SAndroid Build Coastguard Workerr"""List args. 15*800a58d9SAndroid Build Coastguard Worker 16*800a58d9SAndroid Build Coastguard WorkerDefines the list arg parser that holds list specific args. 17*800a58d9SAndroid Build Coastguard Worker""" 18*800a58d9SAndroid Build Coastguard Worker 19*800a58d9SAndroid Build Coastguard WorkerCMD_LIST = "list" 20*800a58d9SAndroid Build Coastguard Worker 21*800a58d9SAndroid Build Coastguard Worker 22*800a58d9SAndroid Build Coastguard Workerdef GetListArgParser(subparser): 23*800a58d9SAndroid Build Coastguard Worker """Return the list arg parser. 24*800a58d9SAndroid Build Coastguard Worker 25*800a58d9SAndroid Build Coastguard Worker Args: 26*800a58d9SAndroid Build Coastguard Worker subparser: argparse.ArgumentParser that is attached to main acloud cmd. 27*800a58d9SAndroid Build Coastguard Worker 28*800a58d9SAndroid Build Coastguard Worker Returns: 29*800a58d9SAndroid Build Coastguard Worker argparse.ArgumentParser with list options defined. 30*800a58d9SAndroid Build Coastguard Worker """ 31*800a58d9SAndroid Build Coastguard Worker list_parser = subparser.add_parser(CMD_LIST) 32*800a58d9SAndroid Build Coastguard Worker list_parser.required = False 33*800a58d9SAndroid Build Coastguard Worker list_parser.set_defaults(which=CMD_LIST) 34*800a58d9SAndroid Build Coastguard Worker list_parser.add_argument( 35*800a58d9SAndroid Build Coastguard Worker "--local-only", 36*800a58d9SAndroid Build Coastguard Worker action="store_true", 37*800a58d9SAndroid Build Coastguard Worker dest="local_only", 38*800a58d9SAndroid Build Coastguard Worker required=False, 39*800a58d9SAndroid Build Coastguard Worker help="Do not authenticate and query remote instances.") 40*800a58d9SAndroid Build Coastguard Worker 41*800a58d9SAndroid Build Coastguard Worker return list_parser 42