blob: 39f0e6ace561f81f0b443830848c686d981f24ba [file] [log] [blame]
Kevin Chengeb85e862018-10-09 15:35:13 -07001#!/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.
16r"""Delete args.
17
18Defines the delete arg parser that holds delete specific args.
19"""
Sam Chiu99dfee32018-11-20 10:19:17 +080020import argparse
Kevin Chengeb85e862018-10-09 15:35:13 -070021
22CMD_DELETE = "delete"
23
24
25def GetDeleteArgParser(subparser):
26 """Return the delete arg parser.
27
28 Args:
29 subparser: argparse.ArgumentParser that is attached to main acloud cmd.
30
31 Returns:
32 argparse.ArgumentParser with delete options defined.
33 """
34 delete_parser = subparser.add_parser(CMD_DELETE)
35 delete_parser.required = False
36 delete_parser.set_defaults(which=CMD_DELETE)
37 delete_parser.add_argument(
Sam Chiu99dfee32018-11-20 10:19:17 +080038 "--instance-names",
Kevin Chengeb85e862018-10-09 15:35:13 -070039 dest="instance_names",
40 nargs="+",
41 required=False,
Sam Chiu99dfee32018-11-20 10:19:17 +080042 help="The names of the remote instances that need to delete, "
43 "separated by spaces, e.g. --instance-names instance-1 instance-2")
Kevin Chengeb85e862018-10-09 15:35:13 -070044 delete_parser.add_argument(
45 "--all",
46 action="store_true",
47 dest="all",
48 required=False,
49 help="If more than 1 AVD instance is found, delete them all.")
50
Sam Chiu99dfee32018-11-20 10:19:17 +080051 # TODO(b/118439885): Old arg formats to support transition, delete when
52 # transistion is done.
53 delete_parser.add_argument(
54 "--instance_names",
55 dest="instance_names",
56 nargs="+",
57 required=False,
58 help=argparse.SUPPRESS)
59
Kevin Chengeb85e862018-10-09 15:35:13 -070060 return delete_parser