mirror of
https://github.com/containers/podman.git
synced 2025-06-21 01:19:15 +08:00
Merge pull request #5762 from baude/v2versionformat
podmanv2 version format variable name change
This commit is contained in:
@ -24,7 +24,7 @@ var (
|
|||||||
RunE: version,
|
RunE: version,
|
||||||
PersistentPreRunE: preRunE,
|
PersistentPreRunE: preRunE,
|
||||||
}
|
}
|
||||||
format string
|
versionFormat string
|
||||||
)
|
)
|
||||||
|
|
||||||
type versionStruct struct {
|
type versionStruct struct {
|
||||||
@ -38,7 +38,7 @@ func init() {
|
|||||||
Command: versionCommand,
|
Command: versionCommand,
|
||||||
})
|
})
|
||||||
flags := versionCommand.Flags()
|
flags := versionCommand.Flags()
|
||||||
flags.StringVarP(&format, "format", "f", "", "Change the output format to JSON or a Go template")
|
flags.StringVarP(&versionFormat, "format", "f", "", "Change the output format to JSON or a Go template")
|
||||||
}
|
}
|
||||||
|
|
||||||
func version(cmd *cobra.Command, args []string) error {
|
func version(cmd *cobra.Command, args []string) error {
|
||||||
@ -62,7 +62,7 @@ func version(cmd *cobra.Command, args []string) error {
|
|||||||
v.Server = v.Client
|
v.Server = v.Client
|
||||||
//}
|
//}
|
||||||
|
|
||||||
versionOutputFormat := format
|
versionOutputFormat := versionFormat
|
||||||
if versionOutputFormat != "" {
|
if versionOutputFormat != "" {
|
||||||
if strings.Join(strings.Fields(versionOutputFormat), "") == "{{json.}}" {
|
if strings.Join(strings.Fields(versionOutputFormat), "") == "{{json.}}" {
|
||||||
versionOutputFormat = formats.JSONString
|
versionOutputFormat = formats.JSONString
|
||||||
|
Reference in New Issue
Block a user