From ad9f720b35a791647e96a6e9a042453db85ab544 Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Sat, 18 Dec 2021 02:29:55 +0300 Subject: flick --- cmd/add.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'cmd/add.go') diff --git a/cmd/add.go b/cmd/add.go index b8979b0..6367f10 100644 --- a/cmd/add.go +++ b/cmd/add.go @@ -3,7 +3,10 @@ package cmd import ( "strings" + "github.com/spf13/afero" "github.com/spf13/cobra" + + "github.com/neonxp/track/internal/tracker" ) // addCmd represents the add command @@ -34,6 +37,14 @@ var addCmd = &cobra.Command{ titles = append(titles, s) } title := strings.Join(titles, " ") + + fs := afero.NewOsFs() + tr, err := tracker.New(fs) + if err != nil { + cmd.PrintErr(err) + return + } + activityID, err := tr.Add(title, tags, contexts) if err != nil { cmd.PrintErr(err) -- cgit v1.2.3