about: add new command 'about' to get quota info from a remote

Implemented for drive only.

Relates to #1138 and #1564.
This commit is contained in:
a-roussos
2018-02-09 22:48:32 +02:00
committed by Nick Craig-Wood
parent b83814082b
commit 94e277d759
9 changed files with 130 additions and 21 deletions

View File

@ -1049,6 +1049,19 @@ func CleanUp(f fs.Fs) error {
return doCleanUp()
}
// About gets quota information from the remote
func About(f fs.Fs) error {
doAbout := f.Features().About
if doAbout == nil {
return errors.Errorf("%v doesn't support about", f)
}
if fs.Config.DryRun {
fs.Logf(f, "Not running about as --dry-run set")
return nil
}
return doAbout()
}
// wrap a Reader and a Closer together into a ReadCloser
type readCloser struct {
io.Reader