openidec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit a0585888dc4d4e252876a3559bf4e526c2828e71
parent 50d48d1c3ac04ec2d0611c2173d078538fa39f47
Author: Peter Kosyh <p.kosyh@gmail.com>
Date:   Fri,  5 Feb 2021 11:36:29 +0300

from opt

Diffstat:
Mii-tool/main.go | 22++++++++++++++++++++++
1 file changed, 22 insertions(+), 0 deletions(-)

diff --git a/ii-tool/main.go b/ii-tool/main.go @@ -79,6 +79,7 @@ Commands: get <msgid> - show message from database select <echo> [[start]:lim] - get slice from echo cc <name> [[start]:lim] - get msgs to name + from <name> [[start]:lim] - get msg from name index - recreate index blacklist <msgid> - blacklist msg useradd <name> <e-mail> <password> - adduser @@ -358,6 +359,27 @@ Options: if m != nil { fmt.Println(m) } + case "from": + if len(args) < 2 { + fmt.Printf("No echo supplied\n") + os.Exit(1) + } + db := open_db(*db_opt) + req := ii.Query{From: args[1]} + if *topics_opt { + req.Repto = "!" + } + if len(args) > 2 { + fmt.Sscanf(args[2], "%d:%d", &req.Start, &req.Lim) + } + resp := db.SelectIDS(req) + for _, v := range resp { + if *verbose_opt { + fmt.Println(db.Get(v)) + } else { + fmt.Println(v) + } + } case "cc": if len(args) < 2 { fmt.Printf("No echo supplied\n")