Refactoring - Renamed CLI flags structure
This commit is contained in:
parent
3266f3f818
commit
0d001985fe
2 changed files with 4 additions and 4 deletions
|
@ -46,7 +46,7 @@ func configureLogFile(path string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure the logging library based on the various command line flags.
|
// Configure the logging library based on the various command line flags.
|
||||||
func configureLogging(flags cliFlags) error {
|
func configureLogging(flags tCliFlags) error {
|
||||||
log = logrus.NewEntry(logrus.New())
|
log = logrus.NewEntry(logrus.New())
|
||||||
log.Logger.SetFormatter(&logrus.TextFormatter{
|
log.Logger.SetFormatter(&logrus.TextFormatter{
|
||||||
DisableColors: true,
|
DisableColors: true,
|
||||||
|
|
6
main.go
6
main.go
|
@ -8,7 +8,7 @@ import (
|
||||||
|
|
||||||
type (
|
type (
|
||||||
// This structure contains all values that may be set from the command line.
|
// This structure contains all values that may be set from the command line.
|
||||||
cliFlags struct {
|
tCliFlags struct {
|
||||||
// The path to the configuration file.
|
// The path to the configuration file.
|
||||||
cfgFile string
|
cfgFile string
|
||||||
// Quiet mode. Will disable logging to stderr.
|
// Quiet mode. Will disable logging to stderr.
|
||||||
|
@ -25,9 +25,9 @@ type (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Parse command line options.
|
// Parse command line options.
|
||||||
func parseCommandLine() cliFlags {
|
func parseCommandLine() tCliFlags {
|
||||||
var help bool
|
var help bool
|
||||||
flags := cliFlags{}
|
flags := tCliFlags{}
|
||||||
|
|
||||||
golf.StringVarP(&flags.cfgFile, 'c', "config", "/etc/fetch-certificates.yml", "Path to the configuration file.")
|
golf.StringVarP(&flags.cfgFile, 'c', "config", "/etc/fetch-certificates.yml", "Path to the configuration file.")
|
||||||
golf.StringVarP(&flags.logFile, 'f', "log-file", "", "Path to the log file.")
|
golf.StringVarP(&flags.logFile, 'f', "log-file", "", "Path to the log file.")
|
||||||
|
|
Loading…
Reference in a new issue