Skip to content

Commit

Permalink
Issue #67: Simplify command line options
Browse files Browse the repository at this point in the history
Simplify options by only defaulting to checking /etc/distributive.d for
checklists if file, URL, stdin, and directory are not specified
  • Loading branch information
nyanshak committed Oct 25, 2015
1 parent 37277db commit e8fc5d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func getFlags() (f string, u string, d string, s bool) {
},
cli.StringFlag{
Name: "directory, d",
Value: "/etc/distributive.d/",
Value: "",
Usage: "Read all of the checklists in this directory",
},
cli.BoolFlag{
Expand All @@ -129,6 +129,11 @@ func getFlags() (f string, u string, d string, s bool) {
URL = c.String("url")
directory = c.String("directory")
stdin = c.Bool("stdin")

if file == "" && URL == "" && stdin == false && directory == "" {
// use default directory if no other options specified
directory = "/etc/distributive.d/"
}
log.WithFields(log.Fields{
"file": file,
"URL": URL,
Expand Down

0 comments on commit e8fc5d3

Please sign in to comment.