Remove unused debug statement, update usage info for --page-length
This commit is contained in:
parent
425857af84
commit
e4a4cb6bcd
|
@ -105,7 +105,7 @@ Flags:
|
||||||
-h, --help help for roulette
|
-h, --help help for roulette
|
||||||
--maximum-files uint32 skip directories with file counts over this value (default 4294967295)
|
--maximum-files uint32 skip directories with file counts over this value (default 4294967295)
|
||||||
--minimum-files uint32 skip directories with file counts under this value
|
--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)
|
-p, --port uint16 port to listen on (default 8080)
|
||||||
--profile register net/http/pprof handlers
|
--profile register net/http/pprof handlers
|
||||||
-r, --recursive recurse into subdirectories
|
-r, --recursive recurse into subdirectories
|
||||||
|
|
|
@ -17,7 +17,7 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version string = "0.58.1"
|
Version string = "0.58.2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -81,7 +81,7 @@ func init() {
|
||||||
rootCmd.Flags().BoolVarP(&filtering, "filter", "f", false, "enable filtering")
|
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(&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().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().Uint16VarP(&port, "port", "p", 8080, "port to listen on")
|
||||||
rootCmd.Flags().BoolVar(&profile, "profile", false, "register net/http/pprof handlers")
|
rootCmd.Flags().BoolVar(&profile, "profile", false, "register net/http/pprof handlers")
|
||||||
rootCmd.Flags().BoolVarP(&recursive, "recursive", "r", false, "recurse into subdirectories")
|
rootCmd.Flags().BoolVarP(&recursive, "recursive", "r", false, "recurse into subdirectories")
|
||||||
|
|
|
@ -627,7 +627,6 @@ func serveDebugHtml(args []string, index *Index, paginate bool) httprouter.Handl
|
||||||
var startIndex, stopIndex int
|
var startIndex, stopIndex int
|
||||||
|
|
||||||
page, err := strconv.Atoi(p.ByName("page"))
|
page, err := strconv.Atoi(p.ByName("page"))
|
||||||
|
|
||||||
if err != nil || page <= 0 {
|
if err != nil || page <= 0 {
|
||||||
startIndex = 0
|
startIndex = 0
|
||||||
stopIndex = len(indexDump) - 1
|
stopIndex = len(indexDump) - 1
|
||||||
|
@ -669,7 +668,6 @@ func serveDebugHtml(args []string, index *Index, paginate bool) httprouter.Handl
|
||||||
if pageLength != 0 {
|
if pageLength != 0 {
|
||||||
nextPage := page + 1
|
nextPage := page + 1
|
||||||
if nextPage > (len(indexDump) / int(pageLength)) {
|
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)
|
nextPage = len(indexDump) / int(pageLength)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -717,7 +715,6 @@ func serveDebugJson(args []string, index *Index) httprouter.Handle {
|
||||||
var startIndex, stopIndex int
|
var startIndex, stopIndex int
|
||||||
|
|
||||||
page, err := strconv.Atoi(p.ByName("page"))
|
page, err := strconv.Atoi(p.ByName("page"))
|
||||||
|
|
||||||
if err != nil || page <= 0 {
|
if err != nil || page <= 0 {
|
||||||
startIndex = 0
|
startIndex = 0
|
||||||
stopIndex = len(indexDump) - 1
|
stopIndex = len(indexDump) - 1
|
||||||
|
|
Loading…
Reference in New Issue