(cmd *cobra.Command)
| 27 | var _ Interface = (*PaginationOpts)(nil) |
| 28 | |
| 29 | func (o *PaginationOpts) AddFlags(cmd *cobra.Command) { |
| 30 | defaultLimit := 10 |
| 31 | if o.DefaultLimit != 0 { |
| 32 | defaultLimit = o.DefaultLimit |
| 33 | } |
| 34 | |
| 35 | cmd.PersistentFlags().IntVar(&o.Limit, "limit", defaultLimit, "number of items to show") |
| 36 | cmd.PersistentFlags().StringVar(&o.NextCursor, "next", "", "cursor to load the next page") |
| 37 | } |
| 38 | |
| 39 | type OffsetPaginationOpts struct { |
| 40 | DefaultLimit int |
no outgoing calls
no test coverage detected