diff options
author | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2021-12-18 02:29:55 +0300 |
---|---|---|
committer | Alexander Kiryukhin <a.kiryukhin@mail.ru> | 2022-02-23 22:06:16 +0300 |
commit | ad9f720b35a791647e96a6e9a042453db85ab544 (patch) | |
tree | e25e81cc3a6bf56b644addc1f8d6f46d955df1e0 /cmd/add.go | |
parent | 8f08151c005341fbc48745104578a8f7549a23d7 (diff) |
Diffstat (limited to 'cmd/add.go')
-rw-r--r-- | cmd/add.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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) |