(cmd *cobra.Command, path string, formatValue string)
| 115 | } |
| 116 | |
| 117 | func printAllPages(cmd *cobra.Command, path string, formatValue string) { |
| 118 | _, hwm, err := guts_cli.ReadPageAndHWMSize(path) |
| 119 | if err != nil { |
| 120 | fmt.Fprintf(cmd.OutOrStdout(), "cannot read number of pages: %v", err) |
| 121 | } |
| 122 | |
| 123 | // print each page listed. |
| 124 | for pageID := uint64(0); pageID < uint64(hwm); { |
| 125 | // print a separator. |
| 126 | if pageID > 0 { |
| 127 | fmt.Fprintln(cmd.OutOrStdout(), "===============================================") |
| 128 | } |
| 129 | overflow, pErr := printPage(cmd, path, pageID, formatValue) |
| 130 | if pErr != nil { |
| 131 | fmt.Fprintf(cmd.OutOrStdout(), "Prining page %d failed: %s. Continuing...\n", pageID, pErr) |
| 132 | pageID++ |
| 133 | } else { |
| 134 | pageID += uint64(overflow) + 1 |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | // pagePrintMeta prints the data from the meta page. |
| 140 | func pagePrintMeta(w io.Writer, buf []byte) error { |
no test coverage detected