|
15 | 15 |
|
16 | 16 | _list_headers = ('ID', 'Date', 'Name', 'Submitter', 'State', 'Archived',
|
17 | 17 | 'Delegate')
|
| 18 | +_sort_fields = ('id', '-id', 'name', '-name', 'date', '-date') |
18 | 19 |
|
19 | 20 |
|
20 | 21 | @click.command(name='apply', context_settings=dict(
|
@@ -194,14 +195,7 @@ def update_cmd(patch_ids, commit_ref, state, delegate, archived, fmt):
|
194 | 195 | 'email or username.')
|
195 | 196 | @click.option('--archived', default=False, is_flag=True,
|
196 | 197 | help='Include patches that are archived.')
|
197 |
| -@click.option('--limit', metavar='LIMIT', type=click.INT, |
198 |
| - help='Maximum number of patches to show.') |
199 |
| -@click.option('--page', metavar='PAGE', type=click.INT, |
200 |
| - help='Page to retrieve patches from. This is influenced by the ' |
201 |
| - 'size of LIMIT.') |
202 |
| -@click.option('--sort', metavar='FIELD', default='-date', type=click.Choice( |
203 |
| - ['id', '-id', 'name', '-name', 'date', '-date']), |
204 |
| - help='Sort output on given field.') |
| 198 | +@utils.pagination_options(sort_fields=_sort_fields, default_sort='-date') |
205 | 199 | @utils.format_options(headers=_list_headers)
|
206 | 200 | @click.argument('name', required=False)
|
207 | 201 | @api.validate_multiple_filter_support
|
|
0 commit comments