Skip to content

Commit

Permalink
add version on release
Browse files Browse the repository at this point in the history
Signed-off-by: tianyang ni <[email protected]>
  • Loading branch information
t1anz0ng committed Aug 2, 2022
1 parent f1a1624 commit 7156bae
Show file tree
Hide file tree
Showing 4 changed files with 1,295 additions and 3 deletions.
1 change: 1 addition & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ builds:
goarch:
- amd64
ldflags:
- -s -w -X main.version={{.Version}}
- -extldflags "-static"
archives:
- replacements:
Expand Down
9 changes: 7 additions & 2 deletions cmd/iftree/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ var (
oTable = pflag.BoolP("table", "t", false, "output in table")

help = pflag.BoolP("help", "h", false, "")

version = "unknown"
)

func init() {
pflag.Usage = func() {
fmt.Println(`Usage:
fmt.Printf(`Usage:
iftree [options]
Example:
Expand All @@ -53,7 +55,10 @@ Example:
-O, --output string graph output name/path (default "output")
-T, --gtype string graph output type, "jpg", "png", "svg", "dot" (graphviz dot language) default "png"
Help Options:
-h, --help Show this help message`)
-h, --help Show this help message
version: %s
`, version)
}
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/TianZong48/iftree

go 1.18
go 1.17

require (
github.com/awalterschulze/gographviz v2.0.3+incompatible
Expand Down
Loading

0 comments on commit 7156bae

Please sign in to comment.