diff --git a/README.md b/README.md index cbfcd65..ca91805 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,7 @@ Flags: -h, --help help for roulette --maximum-files uint32 skip directories with file counts over this value (default 4294967295) --minimum-files uint32 skip directories with file counts under this value - --page-length uint16 pagination length for stats page + --page-length uint16 pagination length for statistics and debug pages -p, --port uint16 port to listen on (default 8080) --profile register net/http/pprof handlers -r, --recursive recurse into subdirectories diff --git a/cmd/root.go b/cmd/root.go index 6e0e24b..a3034c6 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,7 +17,7 @@ var ( ) const ( - Version string = "0.58.1" + Version string = "0.58.2" ) var ( @@ -81,7 +81,7 @@ func init() { rootCmd.Flags().BoolVarP(&filtering, "filter", "f", false, "enable filtering") rootCmd.Flags().Uint32Var(&maximumFileCount, "maximum-files", 1<<32-1, "skip directories with file counts over this value") rootCmd.Flags().Uint32Var(&minimumFileCount, "minimum-files", 0, "skip directories with file counts under this value") - rootCmd.Flags().Uint16Var(&pageLength, "page-length", 0, "pagination length for stats page") + rootCmd.Flags().Uint16Var(&pageLength, "page-length", 0, "pagination length for statistics and debug pages") rootCmd.Flags().Uint16VarP(&port, "port", "p", 8080, "port to listen on") rootCmd.Flags().BoolVar(&profile, "profile", false, "register net/http/pprof handlers") rootCmd.Flags().BoolVarP(&recursive, "recursive", "r", false, "recurse into subdirectories") diff --git a/cmd/web.go b/cmd/web.go index 0e990b3..2f82983 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -627,7 +627,6 @@ func serveDebugHtml(args []string, index *Index, paginate bool) httprouter.Handl var startIndex, stopIndex int page, err := strconv.Atoi(p.ByName("page")) - if err != nil || page <= 0 { startIndex = 0 stopIndex = len(indexDump) - 1 @@ -669,7 +668,6 @@ func serveDebugHtml(args []string, index *Index, paginate bool) httprouter.Handl if pageLength != 0 { nextPage := page + 1 if nextPage > (len(indexDump) / int(pageLength)) { - fmt.Printf("Nextpage (%d) is larger than end of index (%d)\n", nextPage, (len(indexDump) / int(pageLength))) nextPage = len(indexDump) / int(pageLength) } @@ -717,7 +715,6 @@ func serveDebugJson(args []string, index *Index) httprouter.Handle { var startIndex, stopIndex int page, err := strconv.Atoi(p.ByName("page")) - if err != nil || page <= 0 { startIndex = 0 stopIndex = len(indexDump) - 1