summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-01-17 09:50:23 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2020-01-17 09:50:23 -0700
commit85ff0e360408e67d8528e5e6240c345a79bf7021 (patch)
treea4251e2e4543451d673e2d6fc30ed62552c150fe
parente51e56a4944622c0a2c7d19da4bb6b9bb07c1973 (diff)
cmd: version: Add module replace to output
-rw-r--r--cmd/commandfuncs.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go
index 0fd7786..83fc52d 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
}