Skip to content

Commit ccda77c

Browse files
committed
support for --version
1 parent 505abff commit ccda77c

File tree

1 file changed

+8
-0
lines changed
  • cmd/anka-cloud-gitlab-executor

1 file changed

+8
-0
lines changed

cmd/anka-cloud-gitlab-executor/main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ package main
33
import (
44
"context"
55
"errors"
6+
"fmt"
67
"os"
78
"os/signal"
89
"syscall"
910

1011
"github.com/veertuinc/anka-cloud-gitlab-executor/internal/command"
1112
"github.com/veertuinc/anka-cloud-gitlab-executor/internal/gitlab"
1213
"github.com/veertuinc/anka-cloud-gitlab-executor/internal/log"
14+
"github.com/veertuinc/anka-cloud-gitlab-executor/internal/version"
1315
)
1416

1517
var (
@@ -27,6 +29,12 @@ func main() {
2729
}
2830

2931
func run() int {
32+
33+
if len(os.Args) > 1 && os.Args[1] == "--version" {
34+
fmt.Printf("%s", version.Get())
35+
return 0
36+
}
37+
3038
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGTERM)
3139
defer stop()
3240

0 commit comments

Comments
 (0)