This commit is contained in:
AJ ONeal 2021-04-15 02:15:55 -06:00 committed by GitHub
parent 3409d5f2e4
commit 752451d77b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -28,6 +28,11 @@ See <https://pkg.go.dev/git.rootprojects.org/root/go-gitver/v2>.
package main
import (
"fmt"
"strings"
)
var (
commit = "0000000"
version = "0.0.0-pre0+0000000"
@ -35,7 +40,7 @@ var (
)
func main() {
if (len(os.Args) > 1 && "version" === os.Args[1]) {
if (len(os.Args) > 1 && "version" == strings.TrimLeft(os.Args[1], "-")) {
fmt.Printf("Foobar v%s (%s) %s\n", version, commit[:7], date)
}
// ...