File tree Expand file tree Collapse file tree 3 files changed +14
-7
lines changed
Expand file tree Collapse file tree 3 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ builds:
1616 - 386
1717 main : ./cmd/aces
1818 ldflags :
19- - -s -w
19+ - -s -w -X main.version=v{{.Version}} # -X main.commit={{.Commit}} -X main.date={{.Date}}
2020 ignore : # problems with build
2121 - goos : windows
2222 goarch : arm64
Original file line number Diff line number Diff line change @@ -65,9 +65,9 @@ Head over to [releases](https://github.com/quackduck/aces/releases) and download
6565Aces - Encode in any character set
6666
6767Usage :
68- aces <charset> - encode data from STDIN into <charset>
69- aces -d/--decode <charset> - decode data from STDIN from <charset>
70- aces -h/--help - print this help message
68+ aces <charset> - encode data from STDIN into <charset>
69+ aces -d/--decode <charset> - decode data from STDIN from <charset>
70+ aces -v/--version | - h/--help - print version or this help message
7171
7272 Aces reads from STDIN for your data and outputs the result to STDOUT. An optimized algorithm is used
7373 for character sets with a power of 2 length. Newlines are ignored when decoding.
Original file line number Diff line number Diff line change 1212 helpMsg = `Aces - Encode in any character set
1313
1414Usage:
15- aces <charset> - encode data from STDIN into <charset>
16- aces -d/--decode <charset> - decode data from STDIN from <charset>
17- aces -h/--help - print this help message
15+ aces <charset> - encode data from STDIN into <charset>
16+ aces -d/--decode <charset> - decode data from STDIN from <charset>
17+ aces -v/--version | - h/--help - print version or this help message
1818
1919Aces reads from STDIN for your data and outputs the result to STDOUT. An optimized algorithm is used
2020for character sets with a power of 2 length. Newlines are ignored when decoding.
@@ -31,6 +31,7 @@ Examples:
3131Set the encoding/decoding buffer size with --bufsize <size> (default 16KiB).
3232
3333File issues, contribute or star at github.com/quackduck/aces`
34+ version = "dev"
3435)
3536
3637func main () {
@@ -60,6 +61,12 @@ func main() {
6061 fmt .Println (helpMsg )
6162 return
6263 }
64+
65+ if os .Args [1 ] == "-v" || os .Args [1 ] == "--version" {
66+ fmt .Println ("Aces " + version )
67+ return
68+ }
69+
6370 decode := os .Args [1 ] == "--decode" || os .Args [1 ] == "-d"
6471 if decode {
6572 if len (os .Args ) == 2 {
You can’t perform that action at this time.
0 commit comments