From 36bd8f2361e071e9f1d612b5e88b8ac713b8418c Mon Sep 17 00:00:00 2001 From: Andinus Date: Sun, 22 Mar 2020 14:05:00 +0530 Subject: Add version command & use extract instead of description Description is nice but most of the words that I lookup have better explanation in extract. --- cmd/indus/main.go | 6 ++++++ summarize/wikipedia.go | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/indus/main.go b/cmd/indus/main.go index ce3aa91..a49778f 100644 --- a/cmd/indus/main.go +++ b/cmd/indus/main.go @@ -3,6 +3,7 @@ package main import ( "fmt" "log" + "os" "framagit.org/andinus/indus/clipboard" "framagit.org/andinus/indus/fetch" @@ -10,6 +11,11 @@ import ( ) func main() { + if len(os.Args) > 1 && os.Args[1] == "version" { + fmt.Println("Indus v0.1.0") + os.Exit(0) + } + // Get the primary clipboard selection. sel, err := clipboard.GetSel() if err != nil { diff --git a/summarize/wikipedia.go b/summarize/wikipedia.go index c4a5050..f74c753 100644 --- a/summarize/wikipedia.go +++ b/summarize/wikipedia.go @@ -17,8 +17,8 @@ func Wikipedia(w fetch.Wiki) (notification.Notif, error) { // with other page types to get summary. switch w.Type { case "standard": - n.Title = fmt.Sprintf("%s - Wikipedia", w.Title) - n.Message = w.Description + n.Title = fmt.Sprintf("%s", w.Title) + n.Message = w.Extract default: err = fmt.Errorf("Summarizing wikipedia response failed") } -- cgit 1.4.1-2-gfad0