Example #1
0
// ----------------------------------------------------------------
func main() {
	args := os.Args[1:]

	istream, err := argf.Open(args)
	if err != nil {
		log.Println(err)
		os.Exit(1)
	}

	err = cat(istream)

	if err != nil {
		log.Println(err)
		os.Exit(1)
	} else {
		os.Exit(0)
	}
}
Example #2
0
// ----------------------------------------------------------------
func main() {
	pDoRaw := flag.Bool("r", false, "Count lines")

	flag.Usage = usage
	flag.Parse()
	args := flag.Args()

	doRaw := *pDoRaw

	istream, err := argf.Open(args)
	if err != nil {
		log.Println(err)
		os.Exit(1)
	}

	err = hexDump(istream, doRaw)
	if err != nil {
		log.Println(err)
		os.Exit(1)
	}

	os.Exit(0)
}