Skip to content

Commit

Permalink
feat: add current version in cli
Browse files Browse the repository at this point in the history
Signed-off-by: r3drun3 <[email protected]>
  • Loading branch information
R3DRUN3 committed Mar 29, 2024
1 parent cc4c81a commit 768ed50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ var utilities = []UtilityRunner{
{"Hack Bitcoin 👾", nil, ""},
}

func Run() {
func Run(version string) {
for {
utility := chooseUtility()
utility := chooseUtility(version)
if utility == "" {
break
}
Expand All @@ -56,12 +56,13 @@ func Run() {
}
}

func chooseUtility() string {
func chooseUtility(version string) string {
var utility string
title := fmt.Sprintf("CraftBit v%s", version)

form := huh.NewForm(
huh.NewGroup(huh.NewNote().
Title("CraftBit").
Title(title).
Description("Welcome to CraftBit, the Bitcoin swiss army knife 🪛\n\nHow may we help you?")),

// Choose a utility.
Expand Down
4 changes: 3 additions & 1 deletion cmd/craftbit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"github.com/stackzoo/craftbit/cli"
)

const version = "0.0.13"

func main() {
cli.Run()
cli.Run(version)
}

0 comments on commit 768ed50

Please sign in to comment.