summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/rsc/mbta/mbta.go
blob: c8c68e6e27e3e2038c1d38e9d7d31548616ae427 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package main

import (
	"io/ioutil"
	"log"
	"os"

	"code.google.com/p/goprotobuf/proto"
	"github.com/mattermost/rsc/gtfs"
)

func main() {
	log.SetFlags(0)
	if len(os.Args) != 2 {
		log.Fatal("usage: mbta file.pb")
	}
	pb, err := ioutil.ReadFile(os.Args[1])
	if err != nil {
		log.Fatal(err)
	}

	var feed gtfs.FeedMessage
	if err := proto.Unmarshal(pb, &feed); err != nil {
		log.Fatal(err)
	}

	proto.MarshalText(os.Stdout, &feed)
}