Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
pin: handle Rm options
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Feb 4, 2019
1 parent bb8d9d1 commit e85e856
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,15 @@ func (api *PinAPI) Ls(ctx context.Context, opts ...caopts.PinLsOption) ([]iface.
return pins, nil
}

func (api *PinAPI) Rm(ctx context.Context, p iface.Path) error {
return api.core().request("pin/rm", p.String()).Exec(ctx, nil)
func (api *PinAPI) Rm(ctx context.Context, p iface.Path, opts ...caopts.PinRmOption) error {
options, err := caopts.PinRmOptions(opts...)
if err != nil {
return err
}

return api.core().request("pin/rm", p.String()).
Option("recursive", options.Recursive).
Exec(ctx, nil)
}

func (api *PinAPI) Update(ctx context.Context, from iface.Path, to iface.Path, opts ...caopts.PinUpdateOption) error {
Expand Down

0 comments on commit e85e856

Please sign in to comment.