Skip to content

Commit fe96305

Browse files
committed
feat: better text ui, version support
1 parent 6cfa225 commit fe96305

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ builds:
1313
main: .
1414
binary: modup
1515
ldflags:
16-
- -s -w
16+
- -s -w -X main.buildTag={{.Tag}}
1717

1818
archives:
1919
- name_template: >-

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ tasks:
1111
test:
1212
cmds:
1313
- go build -tags "fake" -o modup-test .
14-
- defer: rm modup-test
14+
# - defer: rm modup-test
1515
- ./modup-test

main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,19 @@ import (
1010
"github.com/chaindead/modup/internal/tui"
1111
)
1212

13+
var (
14+
buildTag = "dev"
15+
showVersion = pflag.BoolP("version", "v", false, "show version")
16+
)
17+
1318
func main() {
1419
pflag.Parse()
1520

21+
if *showVersion {
22+
fmt.Println("modup", buildTag)
23+
os.Exit(0)
24+
}
25+
1626
if _, err := tea.NewProgram(tui.NewModel()).Run(); err != nil {
1727
fmt.Println("Error running program:", err)
1828
os.Exit(1)

0 commit comments

Comments
 (0)