From 9b28b7df9897353b5921dd13e2d6e07b016ac70a Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 22 Dec 2021 12:48:41 -0700 Subject: keep, readme: config -> path CLI param --- README.md | 4 ++-- keep.go | 14 +++++++------- 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) -- cgit v1.2.3-54-g00ecf