mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-17 04:30:56 +01:00
re-organized pattern matching code
This commit is contained in:
14
lib/io.go
14
lib/io.go
@@ -24,25 +24,29 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func ProcessFiles(c cfg.Config, args []string) error {
|
||||
fds, pattern, err := determineIO(&c, args)
|
||||
func ProcessFiles(c *cfg.Config, args []string) error {
|
||||
fds, pattern, err := determineIO(c, args)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := c.PreparePattern(pattern); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, fd := range fds {
|
||||
data, err := parseFile(c, fd, pattern)
|
||||
data, err := Parse(*c, fd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = PrepareColumns(&c, &data)
|
||||
err = PrepareColumns(c, &data)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
printData(os.Stdout, c, &data)
|
||||
printData(os.Stdout, *c, &data)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user