diff options
| author | lost+skunk <[email protected]> | 2024-09-03 15:36:19 +0300 |
|---|---|---|
| committer | lost+skunk <[email protected]> | 2024-09-03 15:36:19 +0300 |
| commit | db53a8bd9004098e6a1507e5826a833fd9efa954 (patch) | |
| tree | b5530d4f9af52a4fbc8b9d7bb7c89bdba8ace250 /app/cli.go | |
| parent | 14645842643c4e5fa542def715ac1629e182388c (diff) | |
| download | skunky-art-db53a8bd9004098e6a1507e5826a833fd9efa954.tar.gz skunky-art-db53a8bd9004098e6a1507e5826a833fd9efa954.tar.bz2 skunky-art-db53a8bd9004098e6a1507e5826a833fd9efa954.zip | |
Два API-эндпоинта
Diffstat (limited to 'app/cli.go')
| -rw-r--r-- | app/cli.go | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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() } |
