Skip to content

Commit

Permalink
Embed and show version
Browse files Browse the repository at this point in the history
  • Loading branch information
puhitaku committed Feb 21, 2025
1 parent 866d050 commit 41998b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.1.0
10 changes: 8 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
_ "embed"
"flag"
"fmt"
"os"
Expand All @@ -13,7 +14,12 @@ import (
"github.com/rs/zerolog/log"
)

var usage = `
//go:embed VERSION
var version string

var usage = fmt.Sprintf(`
tftp-now %s
Usage of tftp-now:
tftp-now <command> [<args>]
Expand Down Expand Up @@ -42,7 +48,7 @@ Tips:
- If tftp-now executable itself or a link to tftp-now is named "tftp-now-serve",
tftp-now will start a TFTP server without any explicit subcommand. Please specify
a subcommand if you want to specify options.
`
`, version)[1:]

func main() {
os.Exit(main_())
Expand Down

0 comments on commit 41998b2

Please sign in to comment.