cmd: Print more detailed version with --environ

This commit is contained in:
Matthew Holt 2021-01-16 12:52:33 -07:00
parent 58e83a811b
commit 8f6f9865d4
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5
2 changed files with 21 additions and 14 deletions

View file

@ -336,19 +336,7 @@ 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", goModule.Sum)
}
if goModule.Replace != nil {
fmt.Printf(" => %s", goModule.Replace.Path)
if goModule.Replace.Version != "" {
fmt.Printf(" %s", goModule.Replace.Version)
}
}
fmt.Println()
fmt.Println(caddyVersion())
return caddy.ExitCodeSuccess, nil
}