summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/caddyhttp/fileserver/command.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/caddyhttp/fileserver/command.go b/modules/caddyhttp/fileserver/command.go
index 0112a5f..bccaf2f 100644
--- a/modules/caddyhttp/fileserver/command.go
+++ b/modules/caddyhttp/fileserver/command.go
@@ -16,7 +16,9 @@ package fileserver
import (
"encoding/json"
+ "io"
"log"
+ "os"
"strconv"
"time"
@@ -57,6 +59,15 @@ respond with a file listing.`,
cmd.Flags().BoolP("access-log", "", false, "Enable the access log")
cmd.Flags().BoolP("debug", "v", false, "Enable verbose debug logs")
cmd.RunE = caddycmd.WrapCommandFuncForCobra(cmdFileServer)
+ cmd.AddCommand(&cobra.Command{
+ Use: "export-template",
+ Short: "Exports the default file browser template",
+ Example: "caddy file-server export-template > browse.html",
+ RunE: func(cmd *cobra.Command, args []string) error {
+ _, err := io.WriteString(os.Stdout, defaultBrowseTemplate)
+ return err
+ },
+ })
},
})
}