From e10c28e345cc3857664e2d92c948f95d15279038 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Fri, 27 Jun 2025 12:23:31 +0700 Subject: cmd/jarink: add "version" command The version command print the version of the program. --- README | 3 ++- cmd/jarink/main.go | 4 ++++ jarink.go | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README b/README index 3d4b14d..02debe8 100644 --- a/README +++ b/README @@ -9,10 +9,11 @@ and maintains their website. jarink [OPTIONS] -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) } diff --git a/jarink.go b/jarink.go index 13f0cd7..d1a1fd3 100644 --- a/jarink.go +++ b/jarink.go @@ -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 -- cgit v1.3