Remove unused debug statement, update usage info for --page-length

This commit is contained in:
Seednode 2023-09-09 19:47:44 -05:00
parent 425857af84
commit e4a4cb6bcd
3 changed files with 3 additions and 6 deletions

View File

@ -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

View File

@ -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")

View File

@ -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