 (defvar bitbucket/project-keys-file "~/.bitbucket-project-keys")
 (defvar bitbucket/url-rest-api "http://cuso.edb.se/stash/rest/api/1.0/")
 
-(defun bitbucket/get-project-keys ()
-  "Gets the Bitbucket projects keys that are 'cached' in bitbucket/project-keys-file."
+(defun bitbucket/get-project-keys (&optional project-keys-file)
+  "Gets the Bitbucket projects keys from PROJECT-KEYS-FILE (defaults to bitbucket/project-keys-file)."
   (split-string (with-temp-buffer
-                  (insert-file-contents bitbucket/project-keys-file)
+                  (insert-file-contents (or project-keys-file bitbucket/project-keys-file))
                   (buffer-string)) "\n" t))
 
 (defun bitbucket/get-clone-commands (repo-regexp)

                        ))
                    ))))

(defun bitbucket/create-clone-script (out-dir username password)
  "Create Bitbucket clone script in OUT-DIR for all repositories.  USERNAME and PASSWORD are used for authentication."
  (interactive
   (list
    (read-directory-name "Output dir: ")
    (read-string (concat "Username (" bitbucket/default-username "): ") nil nil bitbucket/default-username)
    (read-passwd "Password: ")))
  (let ((file-name (concat (if (string-suffix-p "/" out-dir) out-dir (concat out-dir "/")) "clone-script.sh"))

                  (insert clone-commands)
                  (insert "\n")
                  (write-region (point-min) (point-max) file-name t)
                  (kill-buffer)
                  (chmod file-name 484)))))))))

(provide 'bitbucket)

