aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2025-06-27 12:23:31 +0700
committerShulhan <ms@kilabit.info>2025-06-27 12:23:31 +0700
commite10c28e345cc3857664e2d92c948f95d15279038 (patch)
tree1438a25fa93b20fd890c3f8d7e16a5f46a25be38
parent41e53878912e17d22a199435f9cf704ff9c14e2b (diff)
downloadjarink-e10c28e345cc3857664e2d92c948f95d15279038.tar.xz
cmd/jarink: add "version" command
The version command print the version of the program.
-rw-r--r--README3
-rw-r--r--cmd/jarink/main.go4
-rw-r--r--jarink.go3
3 files changed, 9 insertions, 1 deletions
diff --git a/README b/README
index 3d4b14d..02debe8 100644
--- a/README
+++ b/README
@@ -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)
}
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