diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2017-05-05 20:32:19 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2017-05-05 20:32:19 +0200 |
| commit | 22d80eda906d1958dfde5072717a12995ee6df2d (patch) | |
| tree | 2a27f0f621404fce50594a4c5c6ad547cf51e9ab /pkg/rtree/main.go | |
| parent | e1022c29c33363bd3c2471b7cef2d37dbd704dca (diff) | |
| download | gofu-22d80eda906d1958dfde5072717a12995ee6df2d.tar.gz | |
implement rtree drop
rtree is functionally complete, but the implementation is very messy
now. :(
Diffstat (limited to 'pkg/rtree/main.go')
| -rw-r--r-- | pkg/rtree/main.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/pkg/rtree/main.go b/pkg/rtree/main.go index 4c8fb98..683daeb 100644 --- a/pkg/rtree/main.go +++ b/pkg/rtree/main.go @@ -38,7 +38,10 @@ func Exec(args []string) { } commandGet(args[1]) case "drop": - panic("unimplemented") + if len(args) != 2 { + usageAndExit() + } + commandDrop(args[1]) case "index": if len(args) != 1 { usageAndExit() @@ -88,6 +91,15 @@ func commandGet(url string) { } } +func commandDrop(url string) { + index := ReadIndex() + repo := index.InteractiveFindRepo(url, false) + if repo != nil { + index.InteractiveDropRepo(repo) + index.Write() + } +} + func commandIndex() { index := ReadIndex() util.FatalIfError(index.InteractiveRebuild()) |
