()
| 365 | } |
| 366 | |
| 367 | func (g *Grep) AddFlags() { |
| 368 | flag.BoolVar(&g.L, "l", false, "list matching files only") |
| 369 | flag.BoolVar(&g.C, "c", false, "print match counts only") |
| 370 | flag.BoolVar(&g.N, "n", false, "show line numbers") |
| 371 | flag.BoolVar(&g.H, "h", false, "omit file names") |
| 372 | } |
| 373 | |
| 374 | func (g *Grep) File(name string) { |
| 375 | f, err := os.Open(name) |