提交 01e26e4f 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

close task #7500

上级 9ae01cc7
......@@ -5,6 +5,7 @@ import (
constant "github.com/easysoft/zendata/src/utils/const"
i118Utils "github.com/easysoft/zendata/src/utils/i118"
logUtils "github.com/easysoft/zendata/src/utils/log"
"github.com/easysoft/zendata/src/utils/vari"
"gopkg.in/yaml.v3"
"io/ioutil"
"strings"
......@@ -52,6 +53,13 @@ func LoadConfigDef(defaultFile, configFile string, fieldsToExport *[]string) mod
mergerDefine(&defaultDef, &configDef)
orderFields(&defaultDef, *fieldsToExport)
for _, field := range defaultDef.Fields {
if vari.Trim {
field.Prefix = ""
field.Postfix = ""
}
}
return defaultDef
}
......
......@@ -228,7 +228,7 @@ func GenerateFieldValWithFix(field model.DefField, fieldValue model.FieldValue,
*indexOfRow++
}
if withFix {
if withFix && !vari.Trim {
loopStr = prefix + loopStr + postfix
}
......
......@@ -22,6 +22,7 @@ var (
WithHead bool
HeadSep string
Trim bool
JsonResp string = "[]"
Ip string
......
......@@ -101,6 +101,9 @@ func main() {
flagSet.StringVar(&root, "R", "", "")
flagSet.StringVar(&root, "root", "", "")
flagSet.BoolVar(&vari.Trim, "T", false, "")
flagSet.BoolVar(&vari.Trim, "trim", false, "")
flagSet.BoolVar(&example, "e", false, "")
flagSet.BoolVar(&example, "example", false, "")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册