Files
.circleci
.github
backend
bin
cmd
about
all
authorize
cachestats
cat
check
cleanup
cmount
config
copy
copyto
copyurl
cryptcheck
cryptdecode
dbhashsum
dbhashsum.go
dedupe
delete
deletefile
genautocomplete
gendocs
hashsum
info
link
listremotes
ls
lsd
lsf
lsjson
lsl
md5sum
memtest
mkdir
mount
mountlib
move
moveto
ncdu
obscure
purge
rc
rcat
rcd
reveal
rmdir
rmdirs
serve
settier
sha1sum
size
sync
touch
tree
version
cmd.go
help.go
progress.go
progress_other.go
progress_windows.go
siginfo_darwin.go
siginfo_others.go
docs
fs
fstest
graphics
lib
vendor
vfs
.appveyor.yml
.gitignore
.golangci.yml
.pkgr.yml
.travis.yml
CONTRIBUTING.md
COPYING
MAINTAINERS.md
MANUAL.html
MANUAL.md
MANUAL.txt
Makefile
README.md
RELEASE.md
go.mod
go.sum
notes.txt
rclone.1
rclone.go
rclone/cmd/dbhashsum/dbhashsum.go
Aleksandar Jankovic f78cd1e043 Add context propagation to rclone
- Change rclone/fs interfaces to accept context.Context
- Update interface implementations to use context.Context
- Change top level usage to propagate context to lover level functions

Context propagation is needed for stopping transfers and passing other
request-scoped values.
2019-06-19 11:59:46 +01:00

33 lines
855 B
Go

package dbhashsum
import (
"context"
"os"
"github.com/ncw/rclone/cmd"
"github.com/ncw/rclone/fs/operations"
"github.com/spf13/cobra"
)
func init() {
cmd.Root.AddCommand(commandDefintion)
}
var commandDefintion = &cobra.Command{
Use: "dbhashsum remote:path",
Short: `Produces a Dropbox hash file for all the objects in the path.`,
Long: `
Produces a Dropbox hash file for all the objects in the path. The
hashes are calculated according to [Dropbox content hash
rules](https://www.dropbox.com/developers/reference/content-hash).
The output is in the same format as md5sum and sha1sum.
`,
Run: func(command *cobra.Command, args []string) {
cmd.CheckArgs(1, 1, command, args)
fsrc := cmd.NewFsSrc(args)
cmd.Run(false, false, command, func() error {
return operations.DropboxHashSum(context.Background(), fsrc, os.Stdout)
})
},
}