mirror of
https://github.com/rclone/rclone.git
synced 2025-12-11 22:14:05 +01:00
fs: add --metadata/-M flag to control whether metadata is copied
This commit is contained in:
@@ -68,8 +68,14 @@ func GetMetadata(ctx context.Context, o ObjectInfo) (metadata Metadata, err erro
|
||||
|
||||
// GetMetadataOptions from an ObjectInfo and merge it with any in options
|
||||
//
|
||||
// If --metadata isn't in use it will return nil
|
||||
//
|
||||
// If the object has no metadata then metadata will be nil
|
||||
func GetMetadataOptions(ctx context.Context, o ObjectInfo, options []OpenOption) (metadata Metadata, err error) {
|
||||
ci := GetConfig(ctx)
|
||||
if !ci.Metadata {
|
||||
return nil, nil
|
||||
}
|
||||
metadata, err = GetMetadata(ctx, o)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user