Merge branch '16803-shell-sync-tokens' refs #16803
[arvados.git] / tools / keep-rsync / keep-rsync.go
index a299d17febb1a46fc276ab6ed0fac5ee49ac09be..6926a945e193a2a9c052ac02fd99fe240420e340 100644 (file)
@@ -17,10 +17,12 @@ import (
        "strings"
        "time"
 
        "strings"
        "time"
 
-       "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
-       "git.curoverse.com/arvados.git/sdk/go/keepclient"
+       "git.arvados.org/arvados.git/sdk/go/arvadosclient"
+       "git.arvados.org/arvados.git/sdk/go/keepclient"
 )
 
 )
 
+var version = "dev"
+
 func main() {
        err := doMain()
        if err != nil {
 func main() {
        err := doMain()
        if err != nil {
@@ -69,9 +71,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.")
 
                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:])
 
        // 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("keep-rsync %s\n", version)
+               os.Exit(0)
+       }
+
        srcConfig, srcBlobSigningKey, err := loadConfig(*srcConfigFile)
        if err != nil {
                return fmt.Errorf("Error loading src configuration from file: %s", err.Error())
        srcConfig, srcBlobSigningKey, err := loadConfig(*srcConfigFile)
        if err != nil {
                return fmt.Errorf("Error loading src configuration from file: %s", err.Error())