From 4ff116ec291590ec574ff14c53a782d43dd4e51e Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Thu, 28 May 2015 15:56:48 +0200 Subject: [PATCH 1/2] created nonfunctional init command --- chub/init.go | 12 +++++++++++- chub/main.go | 26 ++++++++++++++++++++++++-- chub/util/slices.go | 0 3 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 chub/util/slices.go 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 From 5927618ed7c863ac0eddae54f525b8f4cbe68833 Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Thu, 28 May 2015 15:57:16 +0200 Subject: [PATCH 2/2] removed unneded files --- chub/util/slices.go | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 chub/util/slices.go diff --git a/chub/util/slices.go b/chub/util/slices.go deleted file mode 100644 index e69de29..0000000