Skip to content

Commit

Permalink
Add arguments error if --active specified and ports not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
yuuki committed Feb 28, 2018
1 parent 8ea4384 commit 80b7608
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ func (c *CLI) Run(args []string) int {
r = f
}

if passiveMode && len(ports) == 0 {
if activeMode && len(ports) == 0 {
log.Println("ports required if --active specified")
fmt.Fprint(c.errStream, helpText)
return exitCodeArgumentsError
} else if passiveMode && len(ports) == 0 {
var err error
ports, err = conntrack.LocalListeningPorts()
if err != nil {
Expand Down

0 comments on commit 80b7608

Please sign in to comment.