diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2017-05-02 23:05:09 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2017-05-02 23:05:09 +0200 |
| commit | c69e9f604c47469429a6a8a27ba7ef873134e0a1 (patch) | |
| tree | 9f1fe244cde4fde4b792b1136770af1e48f6fa6d /pkg/rtree/main.go | |
| parent | 72733e8203654cd26464c8c5a6c955b025102cca (diff) | |
| download | gofu-c69e9f604c47469429a6a8a27ba7ef873134e0a1.tar.gz | |
initial implementation of "rtree get" command
Diffstat (limited to 'pkg/rtree/main.go')
| -rw-r--r-- | pkg/rtree/main.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pkg/rtree/main.go b/pkg/rtree/main.go index 9513d06..2a85ab9 100644 --- a/pkg/rtree/main.go +++ b/pkg/rtree/main.go @@ -33,7 +33,10 @@ func Exec(args []string) { } switch args[0] { case "get": - panic("unimplemented") + if len(args) != 2 { + usageAndExit() + } + commandGet(args[1]) case "drop": panic("unimplemented") case "index": @@ -74,6 +77,14 @@ func usageAndExit() { os.Exit(1) } +func commandGet(url string) { + index := ReadIndex() + repo := index.InteractiveFindRepo(url, true) + if repo != nil { + fmt.Println(repo.AbsolutePath()) + } +} + func commandIndex() { index := ReadIndex() util.FatalIfError(index.InteractiveRebuild()) |
