From ad9f720b35a791647e96a6e9a042453db85ab544 Mon Sep 17 00:00:00 2001 From: Alexander Kiryukhin Date: Sat, 18 Dec 2021 02:29:55 +0300 Subject: flick --- cmd/start.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cmd/start.go') diff --git a/cmd/start.go b/cmd/start.go index a0ae4f1..8ec2a11 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -4,7 +4,10 @@ import ( "strconv" "strings" + "github.com/spf13/afero" "github.com/spf13/cobra" + + "github.com/neonxp/track/internal/tracker" ) // startCmd represents the start command @@ -23,11 +26,20 @@ var startCmd = &cobra.Command{ return } comment := strings.Join(args[1:], " ") + + fs := afero.NewOsFs() + tr, err := tracker.New(fs) + if err != nil { + cmd.PrintErr(err) + return + } if err := tr.Start(id, comment); err != nil { cmd.PrintErr(err) return } + activity := tr.Activity(id) + cmd.Printf("Started new span for activity \"%s\".\n", activity.Title) }, } -- cgit v1.2.3