                         ))
                     ))))
 
-(defun bitbucket/create-clone-script (out-dir username password)
+(defun bitbucket/create-clone-script (out-dir project-file 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-file-name (concat "Project file: (" bitbucket/project-keys-file "): ") (expand-file-name "~") bitbucket/project-keys-file t (replace-regexp-in-string ".*/" "/" (expand-file-name bitbucket/project-keys-file)))
     (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"))

(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."
  (split-string (with-temp-buffer
                  (insert-file-contents bitbucket/project-keys-file)
                  (buffer-string)) "\n" t))

(defun bitbucket/get-clone-commands (repo-regexp)

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

(provide 'bitbucket)

