aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan <me@jordan.im>2021-12-22 12:48:41 -0700
committerJordan <me@jordan.im>2021-12-22 12:48:41 -0700
commit9b28b7df9897353b5921dd13e2d6e07b016ac70a (patch)
treeb74a758c504dd3b4c0afad5bdb9ab80d66ca8c50
parentb8cd19d3ccba302a8f45467bff6a1cd7841a3ef2 (diff)
downloadkeep-9b28b7df9897353b5921dd13e2d6e07b016ac70a.tar.gz
keep-9b28b7df9897353b5921dd13e2d6e07b016ac70a.zip
keep, readme: config -> path CLI param
-rw-r--r--README.md4
-rw-r--r--keep.go14
2 files changed, 9 insertions, 9 deletions
diff --git a/README.md b/README.md
index 17f19ac..795449a 100644
--- a/README.md
+++ b/README.md
@@ -19,6 +19,6 @@ of processed URLs can be found at `127.0.0.1:9099`.
```
Usage of ./keep:
- -config string
- path to configuration file (default "~/.keep/keep.json")
+ -path string
+ path to data directory (default "~/.keep")
```
diff --git a/keep.go b/keep.go
index b7ebb9f..8c7ee9c 100644
--- a/keep.go
+++ b/keep.go
@@ -47,18 +47,18 @@ var (
func main() {
- // ~/.keep directory stores db cache and json config
+ // Directory (default ~/.keep) containing configuration and DB cache
user, err := user.Current()
if err != nil {
log.Fatal(err)
}
- keepDir := path.Join(user.HomeDir, ".keep")
-
- // Default config location: ~/.keep/keep.json
- var configPath string
- flag.StringVar(&configPath, "config", path.Join(keepDir, "keep.json"),
- "path to configuration file")
+ var keepDir string
+ flag.StringVar(&keepDir, "path", path.Join(user.HomeDir, ".keep"),
+ "path to data directory")
flag.Parse()
+
+ // See ./keep.json for set of supported parameters/values
+ configPath := path.Join(keepDir, "keep.json")
conf, err := ioutil.ReadFile(configPath)
if err != nil {
log.Fatal(err)