[#148] Use base name as FileName attribute value

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-11-05 16:58:30 +03:00 committed by Alex Vanin
parent 54818d5a11
commit 64caa15556

View file

@ -10,6 +10,7 @@ import (
"io/ioutil"
"math"
"os"
"path/filepath"
"strconv"
"strings"
"time"
@ -494,7 +495,7 @@ func parseObjectAttrs(cmd *cobra.Command) ([]*object.Attribute, error) {
disableFilename, _ := cmd.Flags().GetBool("disable-filename")
if !disableFilename {
filename := cmd.Flag("file").Value.String()
filename := filepath.Base(cmd.Flag("file").Value.String())
attr := object.NewAttribute()
attr.SetKey(object.AttributeFileName)
attr.SetValue(filename)