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

Function getStdout

cmd/get.go:200–215  ·  view source on GitHub ↗
(cmd *cobra.Command, src string, recursive bool)

Source from the content-addressed store, hash-verified

198}
199
200func getStdout(cmd *cobra.Command, src string, recursive bool) error {
201 if recursive {
202 return invalidArgumentsErrorWithDetails("`get -` cannot be used with --recursive", mergeJSONErrorDetails(operationErrorDetails("download"), flagErrorDetails("recursive")))
203 }
204
205 dbx := filesNewFunc(config)
206
207 meta, err := dbx.GetMetadataContext(currentContext(), files.NewGetMetadataArg(src))
208 if err == nil {
209 if _, ok := meta.(*files.FolderMetadata); ok {
210 return invalidArgumentsErrorfWithDetails("%s is a folder; cannot download folder to stdout", mergeJSONErrorDetails(operationErrorDetails("download"), pathErrorDetails(src)), src)
211 }
212 }
213
214 return withJSONErrorDetails(downloadToStdout(dbx, src, cmd.OutOrStdout()), operationErrorDetails("download"), pathErrorDetails(src))
215}
216
217func getWithClient(dbx filesClient, args []string) (err error) {
218 if len(args) == 0 || len(args) > 2 {

Callers 2

getFunction · 0.85

Calls 10

mergeJSONErrorDetailsFunction · 0.85
operationErrorDetailsFunction · 0.85
flagErrorDetailsFunction · 0.85
currentContextFunction · 0.85
pathErrorDetailsFunction · 0.85
withJSONErrorDetailsFunction · 0.85
downloadToStdoutFunction · 0.85
GetMetadataContextMethod · 0.65