summaryrefslogtreecommitdiff
path: root/nbt/nbtdump
diff options
context:
space:
mode:
Diffstat (limited to 'nbt/nbtdump')
-rw-r--r--nbt/nbtdump/main.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/nbt/nbtdump/main.go b/nbt/nbtdump/main.go
new file mode 100644
index 0000000..bf9dd9b
--- /dev/null
+++ b/nbt/nbtdump/main.go
@@ -0,0 +1,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)
+}