From c69e9f604c47469429a6a8a27ba7ef873134e0a1 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Tue, 2 May 2017 23:05:09 +0200 Subject: initial implementation of "rtree get" command --- pkg/rtree/main.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'pkg/rtree/main.go') 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()) -- cgit v1.3.1