From 66b2a3f444969099ce70ab6a1dfc8040a95d23ad Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Thu, 3 Nov 2022 12:23:36 +0100 Subject: [PATCH] cmd/hepmc2root: improve documentation Signed-off-by: Sebastien Binet --- cmd/hepmc2root/main.go | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/cmd/hepmc2root/main.go b/cmd/hepmc2root/main.go index f6f6c609a..fdc9729c5 100644 --- a/cmd/hepmc2root/main.go +++ b/cmd/hepmc2root/main.go @@ -2,12 +2,21 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// hepmc2root converts HepMC files into ROOT files. +// Command hepmc2root converts a HepMC2 ASCII file into a ROOT file and (flat) tree. +// +// Usage: hepmc2root [OPTIONS] hepmc.ascii // // Example: // -// $> hepmc2root -o hepmc.root hepmc.ascii -// $> hepmc2root -o hepmc.root -t mytree hepmc.ascii +// $> hepmc2root ./hepmc.ascii +// $> hepmc2root -o out.root -t mytree ./hepmc.ascii +// +// Options: +// +// -o string +// path to output ROOT file name (default "out.root") +// -t string +// name of the output tree (default "tree") package main // import "go-hep.org/x/hep/cmd/hepmc2root" import ( @@ -31,6 +40,21 @@ func main() { oname := flag.String("o", "out.root", "path to output ROOT file name") tname := flag.String("t", "tree", "name of the output tree") + flag.Usage = func() { + fmt.Fprintf(os.Stderr, `hepmc2root converts a HepMC2 ASCII file into a ROOT file and (flat) tree. + +Usage: hepmc2root [OPTIONS] hepmc.ascii + +Example: + +$> hepmc2root ./hepmc.ascii +$> hepmc2root -o out.root -t mytree ./hepmc.ascii + +Options: +`) + flag.PrintDefaults() + } + flag.Parse() if flag.NArg() != 1 {