Skip to content

Commit

Permalink
Merge pull request #1597 from onflow/ianthpun/version-check
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthpun authored May 15, 2024
2 parents 1c07fdb + 36936fb commit 7f24ca5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions internal/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ import (
"github.com/onflow/flow-cli/internal/command"
)

var verboseFlag bool

func init() {
Cmd.Flags().BoolVarP(&verboseFlag, "verbose", "v", false, "Show detailed dependency information")
}

type versionCmd struct {
Version string
Commit string
Expand All @@ -44,9 +50,11 @@ func (c versionCmd) Print(format string) error {
txtBuilder.WriteString(fmt.Sprintf("Version: %s\n", c.Version))
txtBuilder.WriteString(fmt.Sprintf("Commit: %s\n", c.Commit))

txtBuilder.WriteString("\nFlow Package Dependencies \n")
for _, dep := range c.Dependencies {
txtBuilder.WriteString(fmt.Sprintf("%s %s\n", dep.Path, dep.Version))
if verboseFlag {
txtBuilder.WriteString("\nFlow Package Dependencies \n")
for _, dep := range c.Dependencies {
txtBuilder.WriteString(fmt.Sprintf("%s %s\n", dep.Path, dep.Version))
}
}

fmt.Println(txtBuilder.String())
Expand Down

0 comments on commit 7f24ca5

Please sign in to comment.