(self, resource, *args, **kwargs)
| 85 | } |
| 86 | |
| 87 | def __init__(self, resource, *args, **kwargs): |
| 88 | |
| 89 | self.default_limit = 50 |
| 90 | |
| 91 | super(KeyValuePairListCommand, self).__init__( |
| 92 | resource, |
| 93 | "list", |
| 94 | "Get the list of the %s most recent %s." |
| 95 | % (self.default_limit, resource.get_plural_display_name().lower()), |
| 96 | *args, |
| 97 | **kwargs, |
| 98 | ) |
| 99 | self.resource_name = resource.get_plural_display_name().lower() |
| 100 | # Filter options |
| 101 | self.parser.add_argument( |
| 102 | "--prefix", |
| 103 | help=( |
| 104 | "Only return values with names starting with " "the provided prefix." |
| 105 | ), |
| 106 | ) |
| 107 | self.parser.add_argument( |
| 108 | "-d", |
| 109 | "--decrypt", |
| 110 | action="store_true", |
| 111 | help="Decrypt secrets and displays plain text.", |
| 112 | ) |
| 113 | self.parser.add_argument( |
| 114 | "-s", |
| 115 | "--scope", |
| 116 | default=DEFAULT_LIST_SCOPE, |
| 117 | dest="scope", |
| 118 | help='Scope item is under. Example: "user".', |
| 119 | ) |
| 120 | self.parser.add_argument( |
| 121 | "-u", |
| 122 | "--user", |
| 123 | dest="user", |
| 124 | default=None, |
| 125 | help="User for user scoped items (admin only).", |
| 126 | ) |
| 127 | self.parser.add_argument( |
| 128 | "-n", |
| 129 | "--last", |
| 130 | type=int, |
| 131 | dest="last", |
| 132 | default=self.default_limit, |
| 133 | help=( |
| 134 | "List N most recent %s. Use -n -1 to fetch the full result \ |
| 135 | set." |
| 136 | % self.resource_name |
| 137 | ), |
| 138 | ) |
| 139 | |
| 140 | @resource.add_auth_token_to_kwargs_from_cli |
| 141 | def run(self, args, **kwargs): |
nothing calls this directly
no test coverage detected