♻️ Better names and add printing methods
This commit is contained in:
parent
f41ac8575f
commit
d5e7f601b6
4 changed files with 41 additions and 17 deletions
|
|
@ -14,6 +14,7 @@ const dataPath = "shows.yml"
|
|||
func main() {
|
||||
loop := pflag.BoolP("loop", "l", false, "Loop")
|
||||
help := pflag.BoolP("help", "h", false, "Get Help")
|
||||
dryRun := pflag.BoolP("dry-run", "d", false, "Do a dry run")
|
||||
pflag.Parse()
|
||||
|
||||
if *help {
|
||||
|
|
@ -21,6 +22,12 @@ func main() {
|
|||
os.Exit(2)
|
||||
}
|
||||
|
||||
*dryRun = true // @todo temp
|
||||
var walker convids.ShowWalker
|
||||
if *dryRun {
|
||||
walker = convids.DryRun(os.Stdout)
|
||||
}
|
||||
|
||||
if *loop {
|
||||
fmt.Println("looping")
|
||||
}
|
||||
|
|
@ -28,9 +35,6 @@ func main() {
|
|||
data, err := convids.NewData(dataPath)
|
||||
e.HandleErr(err)
|
||||
|
||||
convids.WalkFiles(data, false, false, func(s *convids.Show, path string) error {
|
||||
fmt.Printf("%s for %+v\n", path, s)
|
||||
return nil
|
||||
})
|
||||
convids.WalkFiles(data, false, convids.PrintGroupName(os.Stdout), walker)
|
||||
fmt.Println("Done!")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue