summaryrefslogtreecommitdiff
path: root/conf/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'conf/main.go')
-rw-r--r--conf/main.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/conf/main.go b/conf/main.go
index dcd9737..182d97f 100644
--- a/conf/main.go
+++ b/conf/main.go
@@ -5,6 +5,8 @@ import (
"fmt"
"log"
"flag"
+ "strings"
+ "bufio"
db "sanine.net/git/phlox/db"
)
@@ -39,6 +41,19 @@ func OpenDb() {
}
+func ReadLine(prompt string) string {
+ reader := bufio.NewReader(os.Stdin)
+
+ fmt.Print(prompt)
+ line, err := reader.ReadString('\n')
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ return strings.TrimSpace(line)
+}
+
+
func main() {
p = &db.Phlox{}
@@ -50,6 +65,12 @@ func main() {
4: DeleteUser(),
5: UpdatePassword(),
6: ListUsers(),
+
+ 7: CreateEndpoint(),
+ 8: DeleteEndpoint(),
+ 9: SetPath(),
+ 10: SetAddress(),
+ 11: ListEndpoints(),
}
for val, cmd := range cmds {