Files
ax/cmd/inbox.go

31 lines
575 B
Go
Raw Normal View History

2026-03-26 12:48:47 +00:00
package cmd
import (
"axolotl/db"
"axolotl/output"
2026-03-29 18:58:34 +02:00
"axolotl/service"
"fmt"
"os"
2026-03-26 12:48:47 +00:00
"github.com/spf13/cobra"
)
var inboxCmd = &cobra.Command{
Use: "inbox", Short: "Show your inbox",
2026-03-26 12:48:47 +00:00
Run: func(cmd *cobra.Command, args []string) {
d, err := db.GetDB()
if err != nil {
fmt.Fprintln(os.Stderr, err)
2026-03-26 12:48:47 +00:00
return
}
2026-03-29 18:58:34 +02:00
svc := service.NewSQLiteNodeService(d.DB, cfg.GetUser())
if nodes, err := svc.List(service.WithMentions(cfg.GetUser())); err == nil {
output.PrintNodes(cmd.OutOrStdout(), nodes, jsonFlag)
}
2026-03-26 12:48:47 +00:00
},
}
func init() {
rootCmd.AddCommand(inboxCmd)
}