diff --git a/README.md b/README.md index b99d34e..474911b 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,10 @@ This includes relationships between tables and databases. - add setting in config file ``` -# expl conf add host database user pass -c config_file_path +# expl conf add --host host --database database --user user --pass password --conf config_file_path -$expl conf add localhost database1 root "" -c config.yaml -$expl conf add localhost database2 root "" -c config.yaml +$expl conf add --host localhost --database database1 --user root --pass "" --conf config.yaml +$expl conf add --host localhost --database database2 --user root --pass "" --conf config.yaml ``` ## 2. Execute Explian ("explain" sub command) diff --git a/cmd/cmd/conf.go b/cmd/cmd/conf.go index 1e914f3..d20233c 100644 --- a/cmd/cmd/conf.go +++ b/cmd/cmd/conf.go @@ -141,24 +141,22 @@ func init() { rm: remove database and host, user, password... in setting used to explain sql. mapping: create or update table-dtabase mapping. using sing Host and Databse settings created by the above add action command. - parameter: - ex) - expl conf add --host localhost --database database1 --user root --pass password -conf configpath - expl conf rm --host localhost --database database2 --user root --pass password -conf configpath - expl conf mapping -conf configpath // make table-database mapping file in database1 and database2. - option: - -c, --conf: config file. You can set and use "EXPL_CONF" environment variable as a default value. - -d --database: string database. used by any sqls. (using onlh simple mode. not using in table mapping mode) - -H --host: string host used by any sqls.(using onlh simple mode. not using table in mapping mode) - -u --user: string database user used by any sqls.(using onlh simple mode. not using table in mapping mode) - -p --pass: string database password used by any sqls.(using onlh simple mode. not using table in mapping mode) + -d --database: string database. used by any sqls. (using onlh simple mode. not using in table mapping mode) + -H --host: string host used by any sqls.(using onlh simple mode. not using table in mapping mode) + -u --user: string database user used by any sqls.(using onlh simple mode. not using table in mapping mode) + -p --pass: string database password used by any sqls.(using onlh simple mode. not using table in mapping mode) -c, --conf: string config file. it includes table mapping. You can set and use "EXPL_CONF" environment variable as a default value. "EXPL_CONF" environment variable as a default value. value: [mapping file path]: database-table mapping file path. default file is ./table_map.yaml. ex) -c $GOPATH/bin/table-mapping.yaml + + ex) + expl conf add --host localhost --database database1 --user root --pass password -conf configpath + expl conf rm --host localhost --database database2 --user root --pass password -conf configpath + expl conf mapping -conf configpath // make table-database mapping file in database1 and database2. ` confCmd.SetUsageTemplate(template)