Remove debug argument

This commit is contained in:
Seednode 2023-09-14 21:13:12 -05:00
parent bc268db233
commit 0b62009fa3
3 changed files with 3 additions and 21 deletions

View File

@ -121,7 +121,7 @@ Flags:
-i, --info expose informational endpoints
--maximum-files uint32 skip directories with file counts above this value (default 4294967295)
--minimum-files uint32 skip directories with file counts below this value (default 1)
--page-length uint32 pagination length for statistics and debug pages
--page-length uint32 pagination length for info pages
-p, --port uint16 port to listen on (default 8080)
--prefix string root path for http handlers (for reverse proxying) (default "/")
--profile register net/http/pprof handlers

View File

@ -11,7 +11,7 @@ import (
)
const (
ReleaseVersion string = "0.84.3"
ReleaseVersion string = "0.84.4"
)
var (
@ -21,7 +21,6 @@ var (
Cache bool
CacheFile string
Code bool
Debug bool
Filtering bool
Flash bool
Handlers bool
@ -71,7 +70,6 @@ func init() {
rootCmd.Flags().BoolVarP(&Cache, "cache", "c", false, "generate directory cache at startup")
rootCmd.Flags().StringVar(&CacheFile, "cache-file", "", "path to optional persistent cache file")
rootCmd.Flags().BoolVar(&Code, "code", false, "enable support for source code files")
rootCmd.Flags().BoolVar(&Debug, "debug", false, "display debug information")
rootCmd.Flags().BoolVarP(&Filtering, "filter", "f", false, "enable filtering")
rootCmd.Flags().BoolVar(&Flash, "flash", false, "enable support for shockwave flash files (via ruffle.rs)")
rootCmd.Flags().BoolVar(&Handlers, "handlers", false, "display registered handlers (for debugging)")
@ -79,7 +77,7 @@ func init() {
rootCmd.Flags().BoolVarP(&Info, "info", "i", false, "expose informational endpoints")
rootCmd.Flags().Uint32Var(&MaximumFileCount, "maximum-files", 1<<32-1, "skip directories with file counts above this value")
rootCmd.Flags().Uint32Var(&MinimumFileCount, "minimum-files", 1, "skip directories with file counts below this value")
rootCmd.Flags().Uint32Var(&PageLength, "page-length", 0, "pagination length for statistics and debug pages")
rootCmd.Flags().Uint32Var(&PageLength, "page-length", 0, "pagination length for info pages")
rootCmd.Flags().Uint16VarP(&Port, "port", "p", 8080, "port to listen on")
rootCmd.Flags().StringVar(&Prefix, "prefix", "/", "root path for http handlers (for reverse proxying)")
rootCmd.Flags().BoolVar(&Profile, "profile", false, "register net/http/pprof handlers")

View File

@ -49,9 +49,6 @@ func serveStaticFile(paths []string, cache *fileCache) httprouter.Handle {
if err != nil {
fmt.Println(err)
if Debug {
fmt.Printf("Call to stripQueryParams(%v) failed inside serveStaticFile()\n", path)
}
serverError(w, r, nil)
return
@ -61,9 +58,6 @@ func serveStaticFile(paths []string, cache *fileCache) httprouter.Handle {
if err != nil {
fmt.Println(err)
if Debug {
fmt.Printf("Call to filepath.EvalSymlinks(%v) failed inside serveStaticFile()\n", strings.TrimPrefix(prefixedFilePath, prefix))
}
serverError(w, r, nil)
return
@ -77,9 +71,6 @@ func serveStaticFile(paths []string, cache *fileCache) httprouter.Handle {
exists, err := fileExists(filePath)
if err != nil {
if Debug {
fmt.Printf("Call to fileExists(%v) failed inside serveStaticFile()\n", filePath)
}
serverError(w, r, nil)
return
@ -95,9 +86,6 @@ func serveStaticFile(paths []string, cache *fileCache) httprouter.Handle {
buf, err := os.ReadFile(filePath)
if err != nil {
if Debug {
fmt.Printf("Call to os.ReadFile(%v) failed inside serveStaticFile()\n", filePath)
}
serverError(w, r, nil)
return
@ -110,10 +98,6 @@ func serveStaticFile(paths []string, cache *fileCache) httprouter.Handle {
if Russian {
err = os.Remove(filePath)
if err != nil {
if Debug {
fmt.Printf("Call to os.Remove(%v) failed inside serveStaticFile()\n", filePath)
}
serverError(w, r, nil)
return