| 96 | } |
| 97 | |
| 98 | func runUpdate(args []string) { |
| 99 | fs := flag.NewFlagSet("update", flag.ExitOnError) |
| 100 | configPath := fs.String("config", "configs/pipeline.yml", "config file path") |
| 101 | source := fs.String("source", "", "source name") |
| 102 | dryRun := fs.Bool("dry-run", false, "show what would run") |
| 103 | _ = fs.Parse(args) |
| 104 | |
| 105 | res, err := update.Run(update.Options{ConfigPath: *configPath, SourceName: *source, DryRun: *dryRun}) |
| 106 | if err != nil { |
| 107 | die(err) |
| 108 | } |
| 109 | for _, r := range res { |
| 110 | fmt.Printf("source=%s commit=%s txt_files=%d\n", r.Name, r.Commit, r.DownloadedFiles) |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | func runClassify(args []string) { |
| 115 | fs := flag.NewFlagSet("classify", flag.ExitOnError) |