MCPcopy
hub / github.com/kopia/kopia / setup

Method setup

cli/command_content_rewrite.go:27–41  ·  view source on GitHub ↗
(svc appServices, parent commandParent)

Source from the content-addressed store, hash-verified

25}
26
27func (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
43func (c *commandContentRewrite) runContentRewriteCommand(ctx context.Context, rep repo.DirectRepositoryWriter) error {
44 c.svc.dangerousCommand()

Callers

nothing calls this directly

Calls 3

safetyFlagVarFunction · 0.85
CommandMethod · 0.80

Tested by

no test coverage detected