diff --git a/cmd/ed.go b/cmd/ed.go index 10fe3ea..f2d0e00 100644 --- a/cmd/ed.go +++ b/cmd/ed.go @@ -26,7 +26,7 @@ import ( // edCmd represents the ed command var edCmd = &cobra.Command{ Use: "ed", - Short: "A brief description of your command", + Short: "Edit a todo", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: diff --git a/cmd/ls.go b/cmd/ls.go index 0f4427c..e991d3b 100644 --- a/cmd/ls.go +++ b/cmd/ls.go @@ -29,7 +29,7 @@ import ( // lsCmd represents the ls command var lsCmd = &cobra.Command{ Use: "ls", - Short: "A brief description of your command", + Short: "List todos", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your command. For example: @@ -59,7 +59,6 @@ to quickly create a Cobra application.`, comp = '✓' } t.AppendRow([]interface{}{todo.ID, desc, date, string(comp)}) - // data[i] = []string{strconv.FormatUint(todo.ID, 10), todo.Desc, todo.DueDate.Format("")} } t.SetStyle(table.StyleLight) t.SetAllowedRowLength(cols) diff --git a/cmd/root.go b/cmd/root.go index abfb9b5..b62af03 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -17,7 +17,6 @@ along with this program. If not, see . package cmd import ( - "fmt" "os" "github.com/spf13/cobra" @@ -26,7 +25,7 @@ import ( // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "todo", - Short: "A brief description of your application", + Short: "Minimal todo app", Long: `A longer description that spans multiple lines and likely contains examples and usage of using your application. For example: @@ -35,9 +34,7 @@ This application is a tool to generate the needed files to quickly create a Cobra application.`, // Uncomment the following line if your bare application // has an action associated with it: - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("test") - }, + Run: lsCmd.Run, } // Execute adds all child commands to the root command and sets flags appropriately. @@ -60,5 +57,3 @@ func init() { // when this action is called directly. // rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } - -