diff options
author | Andinus <andinus@nand.sh> | 2020-04-06 23:55:06 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-04-06 23:55:06 +0530 |
commit | 0a6d510d2add0e46e890cc6fcac39d3080ba689b (patch) | |
tree | a45985a0e503ee3736336dc9361d013ed7026629 /cmd | |
parent | 30f7ea8ddf1077ddc3bc289f56dff39c41258827 (diff) | |
download | grus-0a6d510d2add0e46e890cc6fcac39d3080ba689b.tar.gz |
Print anagrams instead of single word
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/grus/grus.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/grus/grus.go b/cmd/grus/grus.go index a68db97..2e04de8 100644 --- a/cmd/grus/grus.go +++ b/cmd/grus/grus.go @@ -47,12 +47,14 @@ func grus() { word := os.Args[1] sorted := lexical.Sort(word) - out, err := search.Word(sorted, db) + anagrams, err := search.Anagrams(sorted, db) if err == sql.ErrNoRows { fmt.Println("Word not found in database.") return } else if err != nil { log.Fatalf("grus: Search failed :: %s", err) } - fmt.Println(out) + for _, w := range anagrams { + fmt.Println(w) + } } |