Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a -version flag to the command-line tool #36

Merged
merged 1 commit into from
Oct 1, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion comcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
"github.com/tylertreat/comcast/throttler"
)

const version = "1.0.0"

func main() {
// TODO: Add support for other options like packet reordering, duplication, etc.
var (
Expand All @@ -23,10 +25,15 @@ func main() {
targetport = flag.String("target-port", "", "Target port(s) (e.g. 80 or 1:65535 or 22,80,443,1000:1010)")
targetproto = flag.String("target-proto", "tcp,udp,icmp", "Target protocol TCP/UDP (e.g. tcp or tcp,udp or icmp)")
dryrun = flag.Bool("dry-run", false, "Specifies whether or not to actually commit the rule changes")
//icmptype = flag.String("icmp-type", "", "icmp message type (e.g. reply or reply,request)") //TODO: Maybe later :3
//icmptype = flag.String("icmp-type", "", "icmp message type (e.g. reply or reply,request)") //TODO: Maybe later :3
version = flag.Bool("version", false, "Print Comcast's version")
)
flag.Parse()

if version {
log.Printf("v%s", version)
}

targetIPv4, targetIPv6 := parseAddrs(*targetaddr)

throttler.Run(&throttler.Config{
Expand Down