Files
job-search/internal/cli/fetch/command.go
T

26 lines
643 B
Go

package fetch
import (
"log/slog"
"git.avsdev.uk/Go/job-search/internal/cli"
"github.com/spf13/cobra"
)
// NewCommand returns the "fetch" command, which fetches opportunities once or as a service.
func NewCommand(opts *cli.Options) *cobra.Command {
cmd := &cobra.Command{
Use: "fetch",
Short: "Fetch current opportunities",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
slog.Debug("fetch.PersistentPreRun")
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
slog.Debug("fetch.PersistentPostRun")
},
}
cmd.AddCommand(commandOnce(opts))
cmd.AddCommand(commandService(opts))
return cmd
}