Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.

Commit f521be9

Browse files
committed
lcio/cmd/lcio-ls: add -print-event, add doc
1 parent a4c7d64 commit f521be9

2 files changed

Lines changed: 11 additions & 52 deletions

File tree

lcio/cmd/lcio-dump/main.go

Lines changed: 0 additions & 50 deletions
This file was deleted.

lcio/cmd/lcio-ls/main.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
// lcio-ls displays the content of a LCIO file.
6+
//
7+
// The default behaviour is to only display RunHeaders and EventHeaders.
8+
// Events' contents can be printed out with the --print-event flag.
59
package main
610

711
import (
@@ -20,8 +24,9 @@ func main() {
2024
log.SetFlags(0)
2125

2226
var (
23-
fname = ""
24-
nevts = flag.Int64("n", -1, "number of events to inspect")
27+
fname = ""
28+
nevts = flag.Int64("n", -1, "number of events to inspect")
29+
printEvent = flag.Bool("print-event", false, "enable event(s) printout")
2530
)
2631

2732
flag.Parse()
@@ -55,6 +60,10 @@ func main() {
5560
fmt.Printf("%v\n", &hdr)
5661
ehdr = hdr
5762
}
63+
if *printEvent {
64+
evt := r.Event()
65+
fmt.Printf("%v\n", &evt)
66+
}
5867
evts++
5968
}
6069
err = r.Err()

0 commit comments

Comments
 (0)