diff --git a/z/entry.go b/z/entry.go index a5f4f4b..0648e5a 100644 --- a/z/entry.go +++ b/z/entry.go @@ -14,6 +14,7 @@ type Entry struct { Finish time.Time `json:"finish,omitempty"` Project string `json:"project,omitempty"` Task string `json:"task,omitempty"` + Notes string `json:"notes,omitempty"` User string `json:"user,omitempty"` SHA1 string `json:"-"` diff --git a/z/project.go b/z/project.go index af27452..13ad288 100644 --- a/z/project.go +++ b/z/project.go @@ -3,6 +3,7 @@ package z import ( "os" "fmt" + // "time" "github.com/spf13/cobra" // "github.com/gookit/color" ) @@ -23,7 +24,6 @@ var projectCmd = &cobra.Command{ user := GetCurrentUser() projectName := args[0] - project, err := database.GetProject(user, projectName) if err != nil { fmt.Printf("%s %+v\n", CharError, err) diff --git a/z/root.go b/z/root.go index 1382cb2..b4f3fec 100644 --- a/z/root.go +++ b/z/root.go @@ -12,6 +12,7 @@ var begin string var finish string var project string var task string +var notes string var force bool diff --git a/z/track.go b/z/track.go index 3f30426..a9cf0e6 100644 --- a/z/track.go +++ b/z/track.go @@ -30,6 +30,10 @@ var trackCmd = &cobra.Command{ os.Exit(1) } + if notes != "" { + newEntry.Notes = notes + } + isRunning := newEntry.Finish.IsZero() _, err = database.AddEntry(user, newEntry, isRunning) @@ -49,6 +53,7 @@ func init() { trackCmd.Flags().StringVarP(&finish, "finish", "s", "", "Time the activity should finish at\n\nEither in the formats 16:00 / 4:00PM \nor relative to the current time, \ne.g. -0:15 (now minus 15 minutes), +1.50 (now plus 1:30h).\nMust be after --begin time.") trackCmd.Flags().StringVarP(&project, "project", "p", "", "Project to be assigned") trackCmd.Flags().StringVarP(&task, "task", "t", "", "Task to be assigned") + trackCmd.Flags().StringVarP(¬es, "notes", "n", "", "Activity notes") trackCmd.Flags().BoolVarP(&force, "force", "f", false, "Force begin tracking of a new task \neven though another one is still running \n(ONLY IF YOU KNOW WHAT YOU'RE DOING!)") var err error