diff --git a/res/en/usage.txt b/res/en/usage.txt index e426bf34c287db713007e95dac2e972a0cad20f0..b8d615c572f1e10637adaff0eec93e401feff727 100644 --- a/res/en/usage.txt +++ b/res/en/usage.txt @@ -10,7 +10,7 @@ Parameters: -F --field This parameter can be used to specify the fields, separated by commas. The default is all fields. -t --table If the output format is sql, using it to specify the table name to insert data to. - --dns Specify MySQL data source connection string, used to insert data to table directly. + --dsn Specify MySQL data source connection string, used to insert data to table directly. --clear Remove data in MySQL table before insert. -T --trim Remove the prefix and postfix of every field when outputting data or decode data to json string. -H --human Output a readable format, print the field name, and use the tab key to split. diff --git a/res/zh/usage.txt b/res/zh/usage.txt index f92a0945bd0896fdd18e037a68d6f708f48c9cf0..f6787b1f56eb727c156aaf53231f6c212de1ce6d 100644 --- a/res/zh/usage.txt +++ b/res/zh/usage.txt @@ -43,7 +43,7 @@ $>zd.exe -d demo\default.yaml -c demo\test.yaml -n 100 -o test.json # 输出jso $>zd.exe -d demo\default.yaml -c demo\test.yaml -n 100 -o test.xml # 输出xml格式的数据。 $>zd.exe -d demo\default.yaml -n 100 -o test.sql -t user # 输出针对user表的insert语句。 $>zd.exe -d demo\default.yaml -n 100 -o test.sql -t user --trim # 输出针对user表的insert语句,去掉前缀和后缀。 -$>zd.exe -c test\test-sql.yaml -t zendata.table_a --trim -dns mysql://root:P2ssw0rd@127.0.0.1:3306/zendata#utf8 --clear # 插入数据到MySQL数据表。 +$>zd.exe -c test\test-sql.yaml -t zendata.table_a --trim -dsn mysql://root:P2ssw0rd@127.0.0.1:3306/zendata#utf8 --clear # 插入数据到MySQL数据表。 $>zd.exe -i demo\zentao.sql -o db # 根据sql的定义生成各表的yaml文件,存储到db目录里面。 $>zd.exe -i demo\article.txt -o demo # 转换文章为yaml配置,输出到demo目录下。 diff --git a/src/zd.go b/src/zd.go index 37655040eb354f3d2829f3bca4af447abe302dc7..d03c2c8344b377b6f32bebfc1a948ca651f52482 100644 --- a/src/zd.go +++ b/src/zd.go @@ -128,7 +128,7 @@ func main() { flagSet.StringVar(&vari.Table, "table", "", "") flagSet.StringVar(&vari.Server, "s", "mysql", "") flagSet.StringVar(&vari.Server, "server", "mysql", "") - flagSet.StringVar(&vari.DBDsn, "dns", "", "") + flagSet.StringVar(&vari.DBDsn, "dsn", "", "") flagSet.BoolVar(&vari.DBClear, "clear", false, "") flagSet.StringVar(&vari.ProtoCls, "cls", "", "")