aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd/commandfuncs.go
diff options
context:
space:
mode:
authorMatthew Holt <[email protected]>2020-01-17 09:50:23 -0700
committerMatthew Holt <[email protected]>2020-01-17 09:50:23 -0700
commit85ff0e360408e67d8528e5e6240c345a79bf7021 (patch)
treea4251e2e4543451d673e2d6fc30ed62552c150fe /cmd/commandfuncs.go
parente51e56a4944622c0a2c7d19da4bb6b9bb07c1973 (diff)
downloadcaddy-85ff0e360408e67d8528e5e6240c345a79bf7021.tar.gz
caddy-85ff0e360408e67d8528e5e6240c345a79bf7021.zip
cmd: version: Add module replace to output
Diffstat (limited to 'cmd/commandfuncs.go')
-rw-r--r--cmd/commandfuncs.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go
index 0fd7786ad..83fc52d5c 100644
--- a/cmd/commandfuncs.go
+++ b/cmd/commandfuncs.go
@@ -312,12 +312,18 @@ func cmdReload(fl Flags) (int, error) {
func cmdVersion(_ Flags) (int, error) {
goModule := caddy.GoModule()
+ fmt.Print(goModule.Version)
if goModule.Sum != "" {
// a build with a known version will also have a checksum
- fmt.Printf("%s %s\n", goModule.Version, goModule.Sum)
- } else {
- fmt.Println(goModule.Version)
+ fmt.Printf(" %s", goModule.Sum)
}
+ if goModule.Replace != nil {
+ fmt.Printf(" => %s", goModule.Replace.Path)
+ if goModule.Replace.Version != "" {
+ fmt.Printf(" %s", goModule.Replace.Version)
+ }
+ }
+ fmt.Println()
return caddy.ExitCodeSuccess, nil
}