MCPcopy
hub / github.com/kopia/kopia / appendActionCommandRows

Function appendActionCommandRows

cli/command_policy_show.go:456–480  ·  view source on GitHub ↗
(rows []policyTableRow, h *policy.ActionCommand)

Source from the content-addressed store, hash-verified

454}
455
456func appendActionCommandRows(rows []policyTableRow, h *policy.ActionCommand) []policyTableRow {
457 if h.Script != "" {
458 rows = append(rows,
459 policyTableRow{" Embedded script (stored in repository):", "", ""},
460 policyTableRow{indentMultilineString(h.Script, " "), "", ""},
461 )
462 } else {
463 rows = append(rows,
464 policyTableRow{" Command:", "", ""},
465 policyTableRow{" " + h.Command + " " + strings.Join(h.Arguments, " "), "", ""})
466 }
467
468 actualMode := h.Mode
469 if actualMode == "" {
470 actualMode = "sync"
471 }
472
473 rows = append(rows,
474 policyTableRow{" Mode:", actualMode, ""},
475 policyTableRow{" Timeout:", (time.Second * time.Duration(h.TimeoutSeconds)).String(), ""},
476 policyTableRow{"", "", ""},
477 )
478
479 return rows
480}
481
482func appendOSSnapshotPolicyRows(rows []policyTableRow, p *policy.Policy, def *policy.Definition) []policyTableRow {
483 rows = append(rows,

Callers 1

appendActionsPolicyRowsFunction · 0.85

Calls 3

indentMultilineStringFunction · 0.85
StringMethod · 0.45
DurationMethod · 0.45

Tested by

no test coverage detected