mirror of
https://github.com/docker/compose.git
synced 2025-07-22 13:14:29 +02:00
Return only numbers in short version
Python version of docker compose removes the v prefix in the version. ``` $ docker-compose version --short 1.25.5 ``` Signed-off-by: Guillaume Rose <gurose@redhat.com>
This commit is contained in:
parent
a279c3a934
commit
99cd90a4b2
@ -18,6 +18,7 @@ package compose
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/docker/compose/v2/cmd/formatter"
|
"github.com/docker/compose/v2/cmd/formatter"
|
||||||
|
|
||||||
@ -52,7 +53,7 @@ func versionCommand() *cobra.Command {
|
|||||||
|
|
||||||
func runVersion(opts versionOptions) {
|
func runVersion(opts versionOptions) {
|
||||||
if opts.short {
|
if opts.short {
|
||||||
fmt.Println(internal.Version)
|
fmt.Println(strings.TrimPrefix(internal.Version, "v"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if opts.format == formatter.JSON {
|
if opts.format == formatter.JSON {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user