From 1c595d7c45360143a93e7172d2b26e8ab07c0c33 Mon Sep 17 00:00:00 2001 From: isthisnagee Date: Wed, 19 Jan 2022 08:32:02 -0800 Subject: [PATCH] Clean up cmd files + cmd line documentation --- cmd/add.go | 10 ---------- cmd/delete.go | 10 ---------- cmd/edit.go | 10 ---------- cmd/editNote.go | 10 ---------- cmd/list.go | 10 ---------- cmd/note.go | 10 ---------- cmd/root.go | 26 ++++++++------------------ cmd/today.go | 10 ---------- 8 files changed, 8 insertions(+), 88 deletions(-) diff --git a/cmd/add.go b/cmd/add.go index 8f33e62..2d3a1ce 100644 --- a/cmd/add.go +++ b/cmd/add.go @@ -32,14 +32,4 @@ This ID can be used in other commands. func init() { rootCmd.AddCommand(addCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // addCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // addCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } diff --git a/cmd/delete.go b/cmd/delete.go index 61ce008..a26ba54 100644 --- a/cmd/delete.go +++ b/cmd/delete.go @@ -57,14 +57,4 @@ var deleteCmd = &cobra.Command{ func init() { rootCmd.AddCommand(deleteCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // deleteCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // deleteCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } diff --git a/cmd/edit.go b/cmd/edit.go index e964032..21cb184 100644 --- a/cmd/edit.go +++ b/cmd/edit.go @@ -62,14 +62,4 @@ var editCmd = &cobra.Command{ func init() { rootCmd.AddCommand(editCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // editCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // editCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } diff --git a/cmd/editNote.go b/cmd/editNote.go index 46d6d17..f61abda 100644 --- a/cmd/editNote.go +++ b/cmd/editNote.go @@ -62,14 +62,4 @@ var editNoteCmd = &cobra.Command{ func init() { editCmd.AddCommand(editNoteCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // editNoteCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // editNoteCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } diff --git a/cmd/list.go b/cmd/list.go index c655179..aada6e1 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -27,14 +27,4 @@ var listCmd = &cobra.Command{ func init() { rootCmd.AddCommand(listCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // listCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // listCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } diff --git a/cmd/note.go b/cmd/note.go index b61b3f6..39ded14 100644 --- a/cmd/note.go +++ b/cmd/note.go @@ -63,14 +63,4 @@ var noteCmd = &cobra.Command{ func init() { addCmd.AddCommand(noteCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // noteCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // noteCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } diff --git a/cmd/root.go b/cmd/root.go index ddb6cfb..8d80033 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -15,17 +15,15 @@ var cfgFile string // rootCmd represents the base command when called without any subcommands var rootCmd = &cobra.Command{ Use: "diary", - Short: "A brief description of your application", - Long: `A longer description that spans multiple lines and likely contains -examples and usage of using your application. For example: - -Cobra is a CLI library for Go that empowers applications. -This application is a tool to generate the needed files -to quickly create a Cobra application. + Short: "A software engineer's log", + Long: `Use diary to keep track of your day. +Example: + +$ diary add "Security meeting minutes" +33 +$ diary add note 33 # opens in your $EDITOR +$ diary list today # Show all the entries added today `, - // Uncomment the following line if your bare application - // has an action associated with it: - // Run: func(cmd *cobra.Command, args []string) { }, } // Execute adds all child commands to the root command and sets flags appropriately. @@ -39,14 +37,6 @@ func Execute() { func init() { cobra.OnInitialize(InitApp) - - // Here you will define your flags and configuration settings. - // Cobra supports persistent flags, which, if defined here, - // will be global for your application. - rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.diary.toml)") - - // Cobra also supports local flags, which will only run - // when this action is called directly. rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") } diff --git a/cmd/today.go b/cmd/today.go index f84c06b..79e1765 100644 --- a/cmd/today.go +++ b/cmd/today.go @@ -50,14 +50,4 @@ var todayCmd = &cobra.Command{ func init() { listCmd.AddCommand(todayCmd) - - // Here you will define your flags and configuration settings. - - // Cobra supports Persistent Flags which will work for this command - // and all subcommands, e.g.: - // todayCmd.PersistentFlags().String("foo", "", "A help for foo") - - // Cobra supports local flags which will only run when this command - // is called directly, e.g.: - // todayCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") }