working commit
This commit is contained in:
@@ -131,6 +131,8 @@ func (util *FileUtil) CreateCollectionCmds() *cobra.Command {
|
||||
Run: util.DeleteCollection,
|
||||
}
|
||||
deleteCollectionCmd.Flags().BoolVarP(&util.deleteCollectionParams.Detail, "detail", "D", false, "Show detail file information")
|
||||
deleteCollectionCmd.Flags().BoolVarP(&util.deleteCollectionParams.Recursive, "recursive", "R", false, "Use path as collection pattern")
|
||||
|
||||
subCmd.AddCommand(deleteCollectionCmd)
|
||||
|
||||
return subCmd
|
||||
@@ -428,6 +430,7 @@ func (util *FileUtil) listCollections(common *CommonFileParams, params *ListColl
|
||||
type DeleteCollectionParams struct {
|
||||
Path string
|
||||
Detail bool
|
||||
Recursive bool
|
||||
}
|
||||
|
||||
type DeleteCollectionResult struct {
|
||||
@@ -451,7 +454,7 @@ func (util *FileUtil) deleteCollection(common *CommonFileParams, params *DeleteC
|
||||
}
|
||||
timeout := time.Duration(common.Timeout) * time.Second
|
||||
ctx, _ := context.WithTimeout(context.Background(), timeout)
|
||||
files, err := client.NewClient().DeleteCollection(ctx, params.Path)
|
||||
files, err := client.NewClient().DeleteCollection(ctx, params.Path, params.Recursive)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user