|
|
@ -4,6 +4,7 @@ import ( |
|
|
|
"context" |
|
|
|
"fmt" |
|
|
|
"git.aiterp.net/lucifer/new-server/app/client" |
|
|
|
"git.aiterp.net/lucifer/new-server/models" |
|
|
|
"log" |
|
|
|
"os" |
|
|
|
) |
|
|
@ -22,6 +23,18 @@ func handlerCmd( |
|
|
|
} |
|
|
|
|
|
|
|
WriteHandlerInfoTable(os.Stdout, handlers) |
|
|
|
case "delete": |
|
|
|
id := cmd.Params.Get(0).Int() |
|
|
|
if id == nil { |
|
|
|
log.Fatalln("ID missing") |
|
|
|
} |
|
|
|
|
|
|
|
handler, err := c.DeleteHandler(ctx, *id) |
|
|
|
if err != nil { |
|
|
|
log.Fatalln(err) |
|
|
|
} |
|
|
|
|
|
|
|
WriteHandlerInfoTable(os.Stdout, []models.EventHandler{*handler}) |
|
|
|
default: |
|
|
|
if cmd.Name != "help" { |
|
|
|
log.Println("Unknown command:", cmd.Name) |
|
|
|