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

Function du

cmd/du.go:47–57  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

45)
46
47func du(cmd *cobra.Command, args []string) (err error) {
48 dbx := usersNewFunc(config)
49 usage, err := dbx.GetSpaceUsageContext(currentContext())
50 if err != nil {
51 return
52 }
53
54 return commandOutput(cmd).Render(func(w io.Writer) error {
55 return renderUsage(w, usage)
56 }, withJSONCommand(cmd, newDuOperationOutput(usage)))
57}
58
59func renderUsage(out io.Writer, usage *users.SpaceUsage) error {
60 fmt.Fprintf(out, "Used: %s\n", humanize.IBytes(usage.Used))

Calls 7

currentContextFunction · 0.85
commandOutputFunction · 0.85
renderUsageFunction · 0.85
withJSONCommandFunction · 0.85
newDuOperationOutputFunction · 0.85
RenderMethod · 0.80
GetSpaceUsageContextMethod · 0.65

Tested by 4

TestDuJSONTeamAllocationFunction · 0.68