2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-22 21:05:10 +00:00

version: add message_type in --json mode

This commit is contained in:
Michael Terry 2024-07-28 08:36:19 -04:00
parent 33c670dd7a
commit 2d250a9135

View File

@ -25,6 +25,7 @@ Exit status is 1 if there was any error.
Run: func(_ *cobra.Command, _ []string) {
if globalOptions.JSON {
type jsonVersion struct {
MessageType string `json:"message_type"` // version
Version string `json:"version"`
GoVersion string `json:"go_version"`
GoOS string `json:"go_os"`
@ -32,6 +33,7 @@ Exit status is 1 if there was any error.
}
jsonS := jsonVersion{
MessageType: "version",
Version: version,
GoVersion: runtime.Version(),
GoOS: runtime.GOOS,