From f48afca7e8ac9b499bb064c6ebd64d5a049b970a Mon Sep 17 00:00:00 2001 From: nemunaire Date: Sun, 12 Jul 2015 16:27:08 +0200 Subject: [PATCH] Add basic command line interface --- .gitignore | 1 + cli/main.go | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .gitignore create mode 100644 cli/main.go diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9e2c193 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +cli/cli diff --git a/cli/main.go b/cli/main.go new file mode 100644 index 0000000..0535718 --- /dev/null +++ b/cli/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "flag" + "fmt" + "log" + "github.com/nemunaire/eyespot/eyespot/cipherts" + "github.com/nemunaire/eyespot/eyespot/protocolts" +) + +func main() { + var protocol = flag.String("protocol", "tcp", "Protocol to test") + var hostname = flag.String("hostname", "localhost", "Hostname to test") + var port = flag.Int("port", 443, "Port to test") + flag.Parse() + + host := fmt.Sprintf("%s:%d", *hostname, *port) + + log.Println(protocolts.Run(*protocol, host)) + log.Println(cipherts.Run(*protocol, host)) +}