aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/main.go b/main.go
index f8a38ae..f70faa4 100644
--- a/main.go
+++ b/main.go
@@ -1,19 +1,20 @@
package main
import (
+ "fmt"
"os"
)
func main() {
- path := "."
- if len(os.Args) > 1 {
- path = os.Args[1]
+ if len(os.Args) != 3 {
+ fmt.Println("usage: dna-backup <source> <dest>")
+ os.Exit(1)
}
- files := make(chan File)
- chunks := make(chan []byte)
- go ListFiles(path, files)
- go ReadFiles(files, chunks)
- StoreChunks(".", chunks)
+ source := os.Args[1]
+ dest := os.Args[2]
+
+ os.MkdirAll(dest, 0775)
+ Commit(source, dest)
}