(cmd *cobra.Command, cfg getPageOptions, dbPath string, pageIDs []uint64)
| 45 | } |
| 46 | |
| 47 | func pageFunc(cmd *cobra.Command, cfg getPageOptions, dbPath string, pageIDs []uint64) (err error) { |
| 48 | if cfg.all && len(pageIDs) != 0 { |
| 49 | return ErrInvalidPageArgs |
| 50 | } |
| 51 | |
| 52 | if _, err := checkSourceDBPath(dbPath); err != nil { |
| 53 | return err |
| 54 | } |
| 55 | |
| 56 | if cfg.all { |
| 57 | printAllPages(cmd, dbPath, cfg.format) |
| 58 | } else { |
| 59 | printPages(cmd, pageIDs, dbPath, cfg.format) |
| 60 | } |
| 61 | |
| 62 | return |
| 63 | } |
| 64 | |
| 65 | func printPages(cmd *cobra.Command, pageIDs []uint64, path string, formatValue string) { |
| 66 | // print each page listed. |
no test coverage detected