blob: 0314b7d3dd98eebc1c243e0c578023612000fbd5 [file] [log] [blame]
Serge Bazanski8d7843c2018-10-04 10:37:36 +01001package main
2
3import (
4 "flag"
5 "io/ioutil"
6
7 "github.com/golang/glog"
8 "github.com/golang/protobuf/proto"
9
10 confpb "code.hackerspace.pl/q3k/topo/proto/config"
11)
12
13var (
14 flagConfigPath string
15)
16
17func init() {
18 flag.Set("logtostderr", "true")
19}
20
21func main() {
22 flag.StringVar(&flagConfigPath, "config_path", "./topo.pb.text", "Text proto configuration of Topo (per config.proto)")
23 flag.Parse()
24
25 data, err := ioutil.ReadFile(flagConfigPath)
26 if err != nil {
27 glog.Exitf("Could not read config: %v", err)
28 }
29
30 config := confpb.Config{}
31 proto.UnmarshalText(string(data), &config)
32 glog.Infof("%+v", config)
33}