28 lines
697 B
Go
28 lines
697 B
Go
package config
|
|
|
|
import (
|
|
"log/slog"
|
|
|
|
"git.avsdev.uk/Go/job-search/internal/cli"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// NewCommand returns the "config" command, which shows and edits the configuration.
|
|
func NewCommand(opts *cli.Options) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "config",
|
|
Short: "Configuration management",
|
|
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
|
slog.Debug("config.PersistentPreRun")
|
|
},
|
|
PersistentPostRun: func(cmd *cobra.Command, args []string) {
|
|
slog.Debug("config.PersistentPostRun")
|
|
},
|
|
}
|
|
cmd.AddCommand(commandShow(opts))
|
|
cmd.AddCommand(commandGet(opts))
|
|
cmd.AddCommand(commandSet(opts))
|
|
cmd.AddCommand(commandInit())
|
|
return cmd
|
|
}
|