probo/cmd/filter.go

45 lines
1 KiB
Go
Raw Normal View History

2024-03-25 15:53:20 +01:00
/*
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
*/
package cmd
import (
"fmt"
"os"
"git.andreafazzi.eu/andrea/probo/cmd/filter"
tea "github.com/charmbracelet/bubbletea"
"github.com/spf13/cobra"
)
// filterCmd represents the filter command
var filterCmd = &cobra.Command{
Use: "filter",
Short: "Create a new filter",
Long: "Create a new filter to select quizzes and participants",
Run: createFilter,
}
func init() {
createCmd.AddCommand(filterCmd)
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// filterCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// filterCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
func createFilter(cmd *cobra.Command, args []string) {
if _, err := tea.NewProgram(filter.New()).Run(); err != nil {
fmt.Println("Error running program:", err)
os.Exit(1)
}
}