diff --git a/chub/init.go b/chub/init.go index 4aabbfc..694c078 100644 --- a/chub/init.go +++ b/chub/init.go @@ -1 +1,11 @@ -package init \ No newline at end of file +package main + +import ( + "fmt" +) + +func initCommand(guid string) { + + fmt.Printf("initializing %v\n", guid) + +} diff --git a/chub/main.go b/chub/main.go index a3edea8..461205b 100644 --- a/chub/main.go +++ b/chub/main.go @@ -1,7 +1,29 @@ package main -import "fmt" +import ( + "fmt" + "os" +) func main() { - fmt.Println("I am going to eat all the configuration I can!") + + if len(os.Args[1:]) < 2 { + usage() + return + } + + command := os.Args[1] + switch { + case command == "init": + machineId := os.Args[2] + initCommand(machineId) + } + +} + +func usage() { + fmt.Println("Configuration Hub v0.1") + fmt.Println("") + fmt.Println("Usage:") + fmt.Println("\tchub init - connects your server to the config hub machine id ") } diff --git a/chub/util/slices.go b/chub/util/slices.go new file mode 100644 index 0000000..e69de29