Skip to content

Commit

Permalink
Stop displaying the Legacy CLI version
Browse files Browse the repository at this point in the history
The version is only displayed as a Legacy CLI version
  • Loading branch information
akalipetis committed Oct 26, 2023
1 parent 9fbc47c commit 39cbeb0
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions commands/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package commands

import (
"fmt"
"strings"

"github.com/fatih/color"
"github.com/spf13/cobra"
Expand All @@ -25,22 +24,17 @@ func newVersionCommand(cnf *config.Config) *cobra.Command {
Short: "Print the version number of the " + cnf.Application.Name,
FParseErrWhitelist: cobra.FParseErrWhitelist{UnknownFlags: true},
Run: func(cmd *cobra.Command, args []string) {
if strings.Split(version, "-")[0] != strings.Split(legacy.LegacyCLIVersion, "-")[0] {
fmt.Fprintf(color.Output, "%s %s\n", cnf.Application.Name, color.CyanString(version))

if viper.GetBool("verbose") {
fmt.Fprintf(
color.Output,
"%s %s (Wrapped legacy CLI %s)\n",
cnf.Application.Name,
color.CyanString(version),
color.CyanString(legacy.LegacyCLIVersion),
"Embedded PHP version %s\n",
color.CyanString(legacy.PHPVersion),
)
} else {
fmt.Fprintf(color.Output, "%s %s (Wrapped)\n", cnf.Application.Name, color.CyanString(version))
}

if viper.GetBool("debug") {
fmt.Fprintf(
color.Output,
"Embedded PHP version %s\n",
"Embedded Legacy CLI version %s\n",
color.CyanString(legacy.PHPVersion),
)
fmt.Fprintf(
Expand Down

0 comments on commit 39cbeb0

Please sign in to comment.