MCPcopy Create free account
hub / github.com/dropbox/dbxcli / rm

Function rm

cmd/rm.go:55–83  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

53)
54
55func rm(cmd *cobra.Command, args []string) error {
56 if len(args) < 1 {
57 return invalidArgumentsErrorWithDetails("rm: missing operand", argumentErrorDetails("path"))
58 }
59
60 opts, err := parseRemoveOptions(cmd)
61 if err != nil {
62 return err
63 }
64
65 dbx := filesNewFunc(config)
66
67 targets, err := validateRemoveTargets(dbx, args, opts)
68 if err != nil {
69 return err
70 }
71
72 results, err := removeTargets(dbx, targets, opts)
73 if err != nil {
74 return err
75 }
76
77 return commandOutput(cmd).Render(func(w io.Writer) error {
78 if !opts.verbose {
79 return nil
80 }
81 return renderRemoveResults(w, results)
82 }, newJSONCommandOperationOutput(cmd, nil, removeOperationResults(results), nil))
83}
84
85func removeOperationResults(results []removeResult) []jsonOperationResult {
86 operationResults := make([]jsonOperationResult, 0, len(results))

Calls 10

argumentErrorDetailsFunction · 0.85
parseRemoveOptionsFunction · 0.85
validateRemoveTargetsFunction · 0.85
removeTargetsFunction · 0.85
commandOutputFunction · 0.85
renderRemoveResultsFunction · 0.85
removeOperationResultsFunction · 0.85
RenderMethod · 0.80