From db53a8bd9004098e6a1507e5826a833fd9efa954 Mon Sep 17 00:00:00 2001 From: lost+skunk Date: Tue, 3 Sep 2024 15:36:19 +0300 Subject: Два API-эндпоинта MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/cli.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'app/cli.go') diff --git a/app/cli.go b/app/cli.go index 261e103..0480bdb 100644 --- a/app/cli.go +++ b/app/cli.go @@ -4,19 +4,20 @@ import ( "bufio" "bytes" "encoding/json" + "html/template" "os" "time" ) func ExecuteCommandLineArguments() { - const helpmsg = `SkunkyArt v1.3.1 [CSS improvements for mobile and the strips on Daily Deviations] + var helpmsg = `SkunkyArt v{{.Version}} [{{.Description}}] Usage: - [-c|--config] | path to config - [-a|--add-instance] | generates 'instances.json' and 'INSTANCES.md' files with ur instance - [-h|--help] | returns this message Example: ./skunkyart -c config.json -Copyright lost+skunk, X11. https://git.macaw.me/skunky/skunkyart/src/tag/v1.3.1` +Copyright lost+skunk, X11. https://git.macaw.me/skunky/skunkyart/src/tag/v{{.Version}}` a := os.Args[1:] for n, x := range a { @@ -28,7 +29,11 @@ Copyright lost+skunk, X11. https://git.macaw.me/skunky/skunkyart/src/tag/v1.3.1` exit("Not enought arguments", 1) } case "-h", "--help": - exit(helpmsg, 0) + var buf bytes.Buffer + t := template.New("help") + t.Parse(helpmsg) + t.Execute(&buf, &Release) + exit(buf.String(), 0) case "-a", "--add-instance": addInstance() } -- cgit v1.2.3