]> ToastFreeware Gitweb - gregoa/movein.git/blobdiff - movein
Add a ls-r / list-remote command.
[gregoa/movein.git] / movein
diff --git a/movein b/movein
index f6d54edc8c16d8ad3c0417aee80492266fd7a887..3e21387de67ee844fadaa76fd8b972a57e479484 100755 (executable)
--- a/movein
+++ b/movein
@@ -34,6 +34,8 @@ SYNOPSIS
   $bn init
   $bn ls
   $bn list
+  $bn ls-r
+  $bn list-remote
   $bn add repository_name
   $bn new repository_name file1 [file2 file3...]
   $bn login repository_name
@@ -44,7 +46,11 @@ COMMANDS
 
   ls
   list
-      show a list of repositories
+      show a list of local repositories
+
+  ls-r
+  list-remote
+      show a list of remote repositories
 
   add repository_name
       checkout the repository from the remote host and add it to
@@ -166,6 +172,12 @@ list() {
     find "${LOCAL_REPOS}" -mindepth 1 -maxdepth 1 -type d | sed 's,^.*/\([^/]*\).git$,\1,'
 }
 
+listremote() {
+    ssh $GIT_HOST "
+        find '${REMOTE_REPOS}' -mindepth 1 -maxdepth 1 -type d | sed 's,^.*/\([^/]*\).git$,\1,'
+    " </dev/null
+}
+
 new() {
     if [ $# -lt 2 ]; then 
        usage
@@ -217,19 +229,25 @@ case "$command" in
        init $@
        ;;
     add)
-        add $@
+       add $@
        ;;
     new)
-        new $@
+       new $@
        ;;
     login)
-        login $@
+       login $@
        ;;
     ls)
-        list
+       list
        ;;
     list)
-        list
+       list
+       ;;
+    ls-r)
+       listremote
+       ;;
+    list-remote)
+       listremote
        ;;
 
     *)