64 lines
1.6 KiB
Go
64 lines
1.6 KiB
Go
/*
|
|
Copyright © 2022 Sameer Rahmani <lxsameer@gnu.org>
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; either version 2
|
|
of the License, or (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
"serene-lang.org/leavitt/pkg/core"
|
|
)
|
|
|
|
// listCmd represents the list command
|
|
var listCmd = &cobra.Command{
|
|
Use: "list",
|
|
Short: "Lists all the TODOs and annotations in the project",
|
|
Long: `Lists all the TODOs and annotations in the project`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Println("list called")
|
|
|
|
files, err := core.FindAllFiles(state)
|
|
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
|
|
core.ProcessFiles(state, *files)
|
|
// state := core.State{
|
|
|
|
// }
|
|
|
|
// blocks, err := core.FindCommentBlocks(&(*files)[0])
|
|
|
|
// if err != nil {
|
|
// panic(err)
|
|
// }
|
|
// fmt.Printf("%s", blocks)
|
|
|
|
},
|
|
}
|
|
|
|
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("path", ".", "Where to find the project")
|
|
}
|