diff options
author | Tom Willemsen | 2012-10-17 01:40:01 +0200 |
---|---|---|
committer | Tom Willemsen | 2012-10-17 01:40:01 +0200 |
commit | aedb4491bdb7ba2d3c7824fc009fd58deea3bf18 (patch) | |
tree | 99368912ea303f3e37a496e7ba1a19628b39d6d2 | |
parent | 8866cc66c3d7055209a3027653aa2c247ba3aad5 (diff) | |
download | gitto-aedb4491bdb7ba2d3c7824fc009fd58deea3bf18.tar.gz gitto-aedb4491bdb7ba2d3c7824fc009fd58deea3bf18.zip |
Add check command
Checks to see if the specified directory has been registered.
-rw-r--r-- | gitto/main.scm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gitto/main.scm b/gitto/main.scm index ee249b5..bf6f5c1 100644 --- a/gitto/main.scm +++ b/gitto/main.scm @@ -90,6 +90,10 @@ gitto [options] (write repositories port) (close-port port))) +(define (repository-registered? repository) + "Check to see if REPOSITORY has been registered." + (format #t "Repository is~a registered~%" (if (known? repository) "" " not"))) + (define (register-repository repository) "Register REPOSITORY in the repository list." (set! repository (realpath repository)) @@ -184,7 +188,8 @@ to the tracked files. Utracked files will not register." (register (single-char #\r) (value #t) (predicate ,git-dir?)) (remove (single-char #\R) (value #t) (predicate ,known?)) (repositories (single-char #\l)) - (purge (single-char #\p)))) + (purge (single-char #\p)) + (check (single-char #\c) (value #t)))) (define (main args) "Parse the command line options and run the appropriate functions." @@ -194,11 +199,13 @@ to the tracked files. Utracked files will not register." (registration-needed? (option-ref options 'register #f)) (removal? (option-ref options 'remove #f)) (list? (option-ref options 'repositories #f)) - (purge? (option-ref options 'purge #f))) + (purge? (option-ref options 'purge #f)) + (check? (option-ref options 'check #f))) (cond (version-wanted? (version)) (help-wanted? (help)) (registration-needed? => register-repository) (removal? => remove-repository) (list? (list-repository-locations)) (purge? (purge)) + (check? => repository-registered?) (#t (list-repositories))))) |