Split fetch from jobsearch into a separate fetcher command, and renamed fetch once to fts-once

job-search no longer has a fetch command. Its subcommands are now in
cmd/fetcher, which reads the same configuration: "fetcher service" runs
every enabled source's fetcher on its interval until stopped, and
"fetcher fts-once" (was "fetch once") fetches from Find a Tender once and
prints the releases as JSON. The new namea say what the commands do,
because service runs every source while fts-once fetches only from Find a
Tender.

The code stays in internal/cli/fetch, where NewCommands replaces the fetch
parent command. once.go is now fts_once.go and commandOnce is
commandFTSOnce. The README's usage, the config README and the find_a_tender
api_root comment now give the new command names.
This commit is contained in:
bwilliams committed 2026-10-16 09:13:10 +01:00
1 parent 5e61c11eb9
commit ac44b45f06
11 files changed
+155 -44

No files matched your search

-2
View File
@@ -27,7 +27,6 @@ import (
"git.avsdev.uk/Go/job-search/internal/cli"
"git.avsdev.uk/Go/job-search/internal/cli/config"
"git.avsdev.uk/Go/job-search/internal/cli/fetch"
"git.avsdev.uk/Go/job-search/internal/cli/migrate"
"git.avsdev.uk/Go/job-search/internal/cli/serve"
"git.avsdev.uk/Go/job-search/internal/cli/version"
@@ -74,7 +73,6 @@ opportunities.
root.AddCommand(
version.NewCommand(),
config.NewCommand(opts),
fetch.NewCommand(opts),
migrate.NewCommand(opts),
serve.NewCommand(opts),
)
+1 -1
View File
@@ -18,7 +18,7 @@ func TestCommandTree(t *testing.T) {
names = append(names, c.Name())
}
commands := []string{"config", "fetch", "migrate", "serve", "version"}
commands := []string{"config", "migrate", "serve", "version"}
for _, want := range commands {
if !slices.Contains(names, want) {
t.Errorf("job-search has no %q command; has %v", want, names)