diff options
| author | Shulhan <ms@kilabit.info> | 2025-06-27 12:23:31 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-06-27 12:23:31 +0700 |
| commit | e10c28e345cc3857664e2d92c948f95d15279038 (patch) | |
| tree | 1438a25fa93b20fd890c3f8d7e16a5f46a25be38 | |
| parent | 41e53878912e17d22a199435f9cf704ff9c14e2b (diff) | |
| download | jarink-e10c28e345cc3857664e2d92c948f95d15279038.tar.xz | |
cmd/jarink: add "version" command
The version command print the version of the program.
| -rw-r--r-- | README | 3 | ||||
| -rw-r--r-- | cmd/jarink/main.go | 4 | ||||
| -rw-r--r-- | jarink.go | 3 |
3 files changed, 9 insertions, 1 deletions
@@ -9,10 +9,11 @@ and maintains their website. jarink [OPTIONS] <COMMAND> <args...> -Available command, +Available commands, brokenlinks - scan the website for broken links (page and images). help - print the usage of the command. + version - print the version of program. == Usage diff --git a/cmd/jarink/main.go b/cmd/jarink/main.go index 88361ea..afd1dbd 100644 --- a/cmd/jarink/main.go +++ b/cmd/jarink/main.go @@ -77,6 +77,10 @@ func main() { log.Println(jarink.GoEmbedReadme) return + case `version`: + log.Println(jarink.Version) + return + default: log.Printf(`Missing or invalid command %q`, cmd) } @@ -7,6 +7,9 @@ import ( _ "embed" ) +// Version of jarink program and module. +var Version = `0.2.0` + // GoEmbedReadme embed the README for showing the usage of program. // //go:embed README |
