瀏覽代碼

cmd/rlpdump: support dumping only the first entity

Péter Szilágyi 8 年之前
父節點
當前提交
436acb4f75
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      cmd/rlpdump/main.go

+ 4 - 0
cmd/rlpdump/main.go

@@ -32,6 +32,7 @@ import (
 var (
 	hexMode = flag.String("hex", "", "dump given hex data")
 	noASCII = flag.Bool("noascii", false, "don't print ASCII strings readably")
+	single  = flag.Bool("single", false, "print only the first element, discard the rest")
 )
 
 func init() {
@@ -82,6 +83,9 @@ func main() {
 			break
 		}
 		fmt.Println()
+		if *single {
+			break
+		}
 	}
 }