@marcel91200 / caddy Mirror · read-only / commits / 85ff0e36
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

cmd: version: Add module replace to output

Matthew Holt committed Jan 17, 2020 at 09:50 UTC 85ff0e360408e67d8528e5e6240c345a79bf7021
1 file changed +9 -3
cmd/commandfuncs.go
+9 -3
@@ -312,12 +312,18 @@ func cmdReload(fl Flags) (int, error) {
312
313 func cmdVersion(_ Flags) (int, error) {
314 goModule := caddy.GoModule()
315 + fmt.Print(goModule.Version)
316 if goModule.Sum != "" {
317 // a build with a known version will also have a checksum
317 - fmt.Printf("%s %s\n", goModule.Version, goModule.Sum)
318 - } else {
319 - fmt.Println(goModule.Version)
318 + fmt.Printf(" %s", goModule.Sum)
319 }
320 + if goModule.Replace != nil {
321 + fmt.Printf(" => %s", goModule.Replace.Path)
322 + if goModule.Replace.Version != "" {
323 + fmt.Printf(" %s", goModule.Replace.Version)
324 + }
325 + }
326 + fmt.Println()
327 return caddy.ExitCodeSuccess, nil
328 }
329