File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -40,8 +40,11 @@ import (
4040 "github.com/go-logr/glogr"
4141 "github.com/prometheus/client_golang/prometheus"
4242 "github.com/prometheus/client_golang/prometheus/promhttp"
43+ "k8s.io/git-sync/pkg/version"
4344)
4445
46+ var flVer = flag .Bool ("version" , false , "print the version and exit" )
47+
4548var flRepo = flag .String ("repo" , envString ("GIT_SYNC_REPO" , "" ),
4649 "the git repository to clone" )
4750var flBranch = flag .String ("branch" , envString ("GIT_SYNC_BRANCH" , "master" ),
@@ -184,6 +187,12 @@ func main() {
184187 setFlagDefaults ()
185188
186189 flag .Parse ()
190+
191+ if * flVer {
192+ fmt .Println (version .VERSION )
193+ os .Exit (0 )
194+ }
195+
187196 if * flRepo == "" {
188197 fmt .Fprintf (os .Stderr , "ERROR: --repo or $GIT_SYNC_REPO must be provided\n " )
189198 flag .Usage ()
You can’t perform that action at this time.
0 commit comments