X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0f5295ae31362eefe182f3a2329b3903d6f82a3b..ca06cfbda0e84d469f7810a280cfa4dfa8997260:/tools/keep-rsync/keep-rsync.go diff --git a/tools/keep-rsync/keep-rsync.go b/tools/keep-rsync/keep-rsync.go index b1513a02a7..df7f1caf3e 100644 --- a/tools/keep-rsync/keep-rsync.go +++ b/tools/keep-rsync/keep-rsync.go @@ -1,3 +1,7 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + package main import ( @@ -15,6 +19,7 @@ import ( "git.curoverse.com/arvados.git/sdk/go/arvadosclient" "git.curoverse.com/arvados.git/sdk/go/keepclient" + arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version" ) func main() { @@ -65,9 +70,20 @@ func doMain() error { 0, "Lifetime of blob permission signatures on source keepservers. If not provided, this will be retrieved from the API server's discovery document.") + getVersion := flags.Bool( + "version", + false, + "Print version information and exit.") + // Parse args; omit the first arg which is the command name flags.Parse(os.Args[1:]) + // Print version information if requested + if *getVersion { + fmt.Printf("Version: %s\n", arvadosVersion.GetVersion()) + os.Exit(0) + } + srcConfig, srcBlobSigningKey, err := loadConfig(*srcConfigFile) if err != nil { return fmt.Errorf("Error loading src configuration from file: %s", err.Error())