Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DoneCmd = &cobra.Command{ Use: "done", Short: "Mark task as Done.", Run: func(cmd *cobra.Command, args []string) { tasks, err := file_storage.LoadFromJson() manager := task_manager.TaskManager{ Tasks: tasks, } if err != nil { fmt.Println("Error initializing load:", err) os.Exit(1) } if len(args) == 0 { fmt.Println("Requires ID as argument") os.Exit(1) } id, err := strconv.Atoi(args[0]) task := *manager.Get(id) manager = *manager.Update(id, task.Name, task.Description, task.Cron, task.Deadline, task.Backlog, true) if err != nil { fmt.Println("Error updating task:", err) os.Exit(1) } err = file_storage.SaveToJson(manager.Tasks) if err != nil { fmt.Println("Error saving task:", err) os.Exit(1) } }, }
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func InitCommands ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.