(self, resource, *args, **kwargs)
| 54 | display_attributes = ["id", "roles", "users", "route", "ttl"] |
| 55 | |
| 56 | def __init__(self, resource, *args, **kwargs): |
| 57 | |
| 58 | self.default_limit = 50 |
| 59 | |
| 60 | super(InquiryListCommand, self).__init__( |
| 61 | resource, |
| 62 | "list", |
| 63 | "Get the list of the %s most recent %s." |
| 64 | % (self.default_limit, resource.get_plural_display_name().lower()), |
| 65 | *args, |
| 66 | **kwargs, |
| 67 | ) |
| 68 | |
| 69 | self.resource_name = resource.get_plural_display_name().lower() |
| 70 | self.parser.add_argument( |
| 71 | "-n", |
| 72 | "--last", |
| 73 | type=int, |
| 74 | dest="last", |
| 75 | default=self.default_limit, |
| 76 | help=( |
| 77 | "List N most recent %s. Use -n -1 to fetch the full result \ |
| 78 | set." |
| 79 | % self.resource_name |
| 80 | ), |
| 81 | ) |
| 82 | |
| 83 | # Display options |
| 84 | self.parser.add_argument( |
| 85 | "-a", |
| 86 | "--attr", |
| 87 | nargs="+", |
| 88 | default=self.display_attributes, |
| 89 | help=( |
| 90 | "List of attributes to include in the " |
| 91 | 'output. "all" will return all ' |
| 92 | "attributes." |
| 93 | ), |
| 94 | ) |
| 95 | self.parser.add_argument( |
| 96 | "-w", |
| 97 | "--width", |
| 98 | nargs="+", |
| 99 | type=int, |
| 100 | default=None, |
| 101 | help=("Set the width of columns in output."), |
| 102 | ) |
| 103 | |
| 104 | @resource.add_auth_token_to_kwargs_from_cli |
| 105 | def run(self, args, **kwargs): |
nothing calls this directly
no test coverage detected