feat: export command
This commit is contained in:
1 parent
92cb9267fc
commit
f97e9b0aa9
3 files changed
+78
No files matched your search
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"github.com/abelith/spellbook/internal/models"
|
||||
"github.com/spf13/cobra"
|
||||
"io"
|
||||
)
|
||||
|
||||
type Application interface {
|
||||
@@ -12,6 +13,7 @@ type Application interface {
|
||||
GetSpells(ctx context.Context, query models.SearchQuery) ([]models.Spell, error)
|
||||
DeleteSpell(ctx context.Context, spellName string) error
|
||||
CastSpell(ctx context.Context, spellCast models.SpellCast) (models.CastResult, error)
|
||||
ExportSpells(ctx context.Context, exp string, w io.Writer) error
|
||||
}
|
||||
|
||||
type CLI struct {
|
||||
@@ -24,6 +26,7 @@ func NewCLI(ver string, app Application) *CLI {
|
||||
NewAddCommand(app),
|
||||
NewRmCommand(app),
|
||||
NewSearchCmd(app),
|
||||
NewExportCmd(app),
|
||||
)
|
||||
|
||||
return &CLI{
|
||||
|
||||
Reference in new issue
Block a user