FileStatsRun carries out parsing and then prints out a single file
(r *cmd.RootCMD, c *cmd.CMD)
| 39 | |
| 40 | // FileStatsRun carries out parsing and then prints out a single file |
| 41 | func FileStatsRun(r *cmd.RootCMD, c *cmd.CMD) { |
| 42 | args := c.Args.(*FileStatsArgs) |
| 43 | for _, entry := range data.ParseMaps() { |
| 44 | if entry.Name == args.Path { |
| 45 | entry.Print() |
| 46 | os.Exit(0) |
| 47 | } |
| 48 | } |
| 49 | fmt.Fprintf(os.Stderr, "File at '%s' not found\n", args.Path) |
| 50 | os.Exit(1) |
| 51 | } |