mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
rc: add NeedsRequest to call.
This commit is contained in:
committed by
Nick Craig-Wood
parent
2121c0fa23
commit
d0de39ebcd
@@ -138,10 +138,11 @@ func rcMoveOrCopyFile(ctx context.Context, in rc.Params, cp bool) (out rc.Params
|
||||
|
||||
func init() {
|
||||
for _, op := range []struct {
|
||||
name string
|
||||
title string
|
||||
help string
|
||||
noRemote bool
|
||||
name string
|
||||
title string
|
||||
help string
|
||||
noRemote bool
|
||||
needsRequest bool
|
||||
}{
|
||||
{name: "mkdir", title: "Make a destination directory or container"},
|
||||
{name: "rmdir", title: "Remove an empty directory or container"},
|
||||
@@ -160,6 +161,7 @@ func init() {
|
||||
rc.Add(rc.Call{
|
||||
Path: "operations/" + op.name,
|
||||
AuthRequired: true,
|
||||
NeedsRequest: op.needsRequest,
|
||||
Fn: func(ctx context.Context, in rc.Params) (rc.Params, error) {
|
||||
return rcSingleCommand(ctx, in, op.name, op.noRemote)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user