(svc appServices, parent commandParent)
| 25 | } |
| 26 | |
| 27 | func (c *commandContentRewrite) setup(svc appServices, parent commandParent) { |
| 28 | cmd := parent.Command("rewrite", "Rewrite content using most recent format").Hidden() |
| 29 | cmd.Arg("contentID", "Identifiers of contents to rewrite").StringsVar(&c.contentRewriteIDs) |
| 30 | cmd.Flag("parallelism", "Number of parallel workers").Default("16").IntVar(&c.contentRewriteParallelism) |
| 31 | |
| 32 | cmd.Flag("short", "Rewrite contents from short packs").BoolVar(&c.contentRewriteShortPacks) |
| 33 | cmd.Flag("format-version", "Rewrite contents using the provided format version").Default("-1").IntVar(&c.contentRewriteFormatVersion) |
| 34 | cmd.Flag("pack-prefix", "Only rewrite contents from pack blobs with a given prefix").StringVar(&c.contentRewritePackPrefix) |
| 35 | cmd.Flag("dry-run", "Do not actually rewrite, only print what would happen").Short('n').BoolVar(&c.contentRewriteDryRun) |
| 36 | c.contentRange.setup(cmd) |
| 37 | safetyFlagVar(cmd, &c.contentRewriteSafety) |
| 38 | cmd.Action(svc.directRepositoryWriteAction(c.runContentRewriteCommand)) |
| 39 | |
| 40 | c.svc = svc |
| 41 | } |
| 42 | |
| 43 | func (c *commandContentRewrite) runContentRewriteCommand(ctx context.Context, rep repo.DirectRepositoryWriter) error { |
| 44 | c.svc.dangerousCommand() |
nothing calls this directly
no test coverage detected