Fixed lint issues and missing documentation
This commit is contained in:
1 parent
7fd321df97
commit
6e6dec68c0
34 files changed
+346
-156
No files matched your search
@@ -9,13 +9,15 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// Options holds the flags shared by every command. Bind registers them on the
|
||||
// root command and RunSetup acts on them.
|
||||
type Options struct {
|
||||
configFile string
|
||||
debug bool
|
||||
quiet bool
|
||||
}
|
||||
|
||||
// Binds common options through the root command
|
||||
// Bind registers the shared flags as persistent flags on the root command cmd.
|
||||
func (o *Options) Bind(cmd *cobra.Command) {
|
||||
pf := cmd.PersistentFlags()
|
||||
pf.StringVarP(&o.configFile, "config", "c", "", "configuration file")
|
||||
@@ -25,7 +27,11 @@ func (o *Options) Bind(cmd *cobra.Command) {
|
||||
)
|
||||
}
|
||||
|
||||
// Setup loads the config and ensure logging is switch to file if needed
|
||||
// RunSetup prepares a command to run and returns its configuration. When
|
||||
// loadConfig is true it loads the configuration (from the --config file if
|
||||
// given), with --debug and --quiet overriding its log level, and then, unless
|
||||
// terminalLog is true, switches logging to the configured log file (staying
|
||||
// on the terminal, with a warning, if none is configured).
|
||||
func (o *Options) RunSetup(
|
||||
cmd *cobra.Command, loadConfig bool, terminalLog bool,
|
||||
) (*config.JobSearchConfig, error) {
|
||||
|
||||
Reference in new issue
Block a user