package fetch import ( "log/slog" "github.com/spf13/cobra" "git.avsdev.uk/Go/job-search/internal/cli" ) // 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("command persistent pre-run", "command", "fetch") }, PersistentPostRun: func(cmd *cobra.Command, args []string) { slog.Debug("command persistent post-run", "command", "fetch") }, } cmd.AddCommand(commandOnce(opts)) cmd.AddCommand(commandService(opts)) return cmd }