summaryrefslogtreecommitdiff
path: root/nbt/nbtdump/main.go
blob: bf9dd9bb9a090ebfe8911269366109415fdc3e95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package main

import (
	"strconv"
	"fmt"
	"os"
	"github.com/kch42/gonbt/nbt"
)

func main() {
	tag, name, err := nbt.ReadNamedTag(os.Stdin)
	if err != nil {
		fmt.Fprintf(os.Stderr, "Could not read NBT data: %s", err)
		os.Exit(1)
	}
	
	fmt.Printf("Tag Name:\n%s\n\nData:\n%s\n", strconv.Quote(name), tag)
}