Refactored main.go into cmd/jobsearch/main.go (in case separate commands are introduced later) which has required the options mechanism to change slightly as well as the logging.

This commit is contained in:
bwilliams committed 2026-10-09 09:29:42 +01:00
1 parent de3ebf68c5
commit 6436253629
14 files changed
+273 -224

No files matched your search

+5 -4
View File
@@ -19,10 +19,11 @@ package config
import (
"log/slog"
"git.avsdev.uk/Go/job-search/internal/cli"
"github.com/spf13/cobra"
)
func NewCommand() *cobra.Command {
func NewCommand(opts *cli.Options) *cobra.Command {
cmd := &cobra.Command{
Use: "config",
Short: "Configuration management",
@@ -33,9 +34,9 @@ func NewCommand() *cobra.Command {
slog.Debug("config.PersistentPostRun")
},
}
cmd.AddCommand(commandShow())
cmd.AddCommand(commandGet())
cmd.AddCommand(commandSet())
cmd.AddCommand(commandShow(opts))
cmd.AddCommand(commandGet(opts))
cmd.AddCommand(commandSet(opts))
cmd.AddCommand(commandInit())
return cmd
}