aboutsummaryrefslogtreecommitdiff
path: root/cmd/start.go
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2021-12-18 02:29:55 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2022-02-23 22:06:16 +0300
commitad9f720b35a791647e96a6e9a042453db85ab544 (patch)
treee25e81cc3a6bf56b644addc1f8d6f46d955df1e0 /cmd/start.go
parent8f08151c005341fbc48745104578a8f7549a23d7 (diff)
Diffstat (limited to 'cmd/start.go')
-rw-r--r--cmd/start.go12
1 files changed, 12 insertions, 0 deletions
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)
},
}