Skip to content

Commit

Permalink
Update Comment/README
Browse files Browse the repository at this point in the history
  • Loading branch information
室岡 豊人 authored and 室岡 豊人 committed Oct 28, 2019
1 parent 8b17a46 commit 0a5f28a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
20 changes: 9 additions & 11 deletions cmd/cmd/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0a5f28a

Please sign in to comment.