7167: Rename conf flags to -src and -dst to match arv-copy. Always add .conf for...
authorTom Clegg <tom@curoverse.com>
Thu, 15 Oct 2015 14:50:13 +0000 (10:50 -0400)
committerTom Clegg <tom@curoverse.com>
Thu, 15 Oct 2015 14:50:13 +0000 (10:50 -0400)
tools/keep-rsync/keep-rsync.go

index d47efd8ebf1127b2f58127b0d1c29e7889a43aa0..c39f0675c6cc52e9935700bbfa157ecba6311f44 100644 (file)
@@ -24,13 +24,13 @@ func main() {
 
        flag.StringVar(
                &srcConfigFile,
-               "src-config-file",
+               "src",
                "",
                "Source configuration filename. May be either a pathname to a config file, or (for example) 'foo' as shorthand for $HOME/.config/arvados/foo.conf")
 
        flag.StringVar(
                &dstConfigFile,
-               "dst-config-file",
+               "dst",
                "",
                "Destination configuration filename. May be either a pathname to a config file, or (for example) 'foo' as shorthand for $HOME/.config/arvados/foo.conf")
 
@@ -117,10 +117,7 @@ var matchTrue = regexp.MustCompile("^(?i:1|yes|true)$")
 // Read config from file
 func readConfigFromFile(filename string) (config apiConfig, blobSigningKey string, err error) {
        if !strings.Contains(filename, "/") {
-               filename = os.Getenv("HOME") + "/.config/arvados/" + filename
-               if !strings.HasSuffix(filename, ".conf") {
-                       filename = filename + ".conf"
-               }
+               filename = os.Getenv("HOME") + "/.config/arvados/" + filename + ".conf"
        }
 
        content, err := ioutil.ReadFile(filename)