feat: cleanup cli

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias
2019-01-06 13:21:31 +00:00
parent 2b8bd28158
commit 999c69de5c
15 changed files with 176 additions and 132 deletions

View File

@@ -83,9 +83,17 @@ func printRules(rules []rules.Rule, id interface{}) {
for id, rule := range rules {
fmt.Printf("(%d) ", id)
if rule.Regex {
fmt.Printf("Allow: %t\tRegex: %s\n", rule.Allow, rule.Regexp.Raw)
if rule.Allow {
fmt.Printf("Allow Regex: \t%s\n", rule.Regexp.Raw)
} else {
fmt.Printf("Disallow Regex: \t%s\n", rule.Regexp.Raw)
}
} else {
fmt.Printf("Allow: %t\tPath: %s\n", rule.Allow, rule.Path)
if rule.Allow {
fmt.Printf("Allow Path: \t%s\n", rule.Path)
} else {
fmt.Printf("Disallow Path: \t%s\n", rule.Path)
}
}
}
}