Files
job-search/internal/cli/fetch/command.go
T
bwilliams e19c8c2b69 Imports split into three groups: standard library, third-party, then this project's own packages
gci is configured with the sections standard, default and localmodule, and
goimports with the module path as its local prefix, so both formatters
agree.
2026-10-14 17:40:06 +01:00

27 lines
644 B
Go

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("fetch.PersistentPreRun")
},
PersistentPostRun: func(cmd *cobra.Command, args []string) {
slog.Debug("fetch.PersistentPostRun")
},
}
cmd.AddCommand(commandOnce(opts))
cmd.AddCommand(commandService(opts))
return cmd
}