lockbox

password manager
Log | Files | Refs | README | LICENSE

commit 6690ef1b8a3b84331c07353312ca1ea4b36a2711
parent 91ee3ead5b451a08a14b252d774df0013098c5ec
Author: Sean Enck <sean@ttypty.com>
Date:   Sun,  8 Dec 2024 09:03:36 -0500

updating docs

Diffstat:
Minternal/app/help/core.go | 11++++++++++-
Minternal/app/help/core_test.go | 2+-
Minternal/app/help/doc/toml.txt | 8++++++--
3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/internal/app/help/core.go b/internal/app/help/core.go @@ -12,6 +12,7 @@ import ( "github.com/seanenck/lockbox/internal/app/commands" "github.com/seanenck/lockbox/internal/backend" + "github.com/seanenck/lockbox/internal/config" "github.com/seanenck/lockbox/internal/util" ) @@ -34,7 +35,12 @@ type ( CompletionsEnv string HelpCommand string HelpConfigCommand string - ReKey struct { + Config struct { + Env string + Home string + XDG string + } + ReKey struct { KeyFile string NoKey string } @@ -110,6 +116,9 @@ func Usage(verbose bool, exe string) ([]string, error) { HelpCommand: commands.Help, HelpConfigCommand: commands.HelpConfig, } + document.Config.Env = config.ConfigEnv + document.Config.Home = config.ConfigHome + document.Config.XDG = config.ConfigXDG document.ReKey.KeyFile = setDocFlag(commands.ReKeyFlags.KeyFile) document.ReKey.NoKey = commands.ReKeyFlags.NoKey document.Hooks.Mode.Pre = string(backend.HookPre) diff --git a/internal/app/help/core_test.go b/internal/app/help/core_test.go @@ -13,7 +13,7 @@ func TestUsage(t *testing.T) { t.Errorf("invalid usage, out of date? %d", len(u)) } u, _ = help.Usage(true, "lb") - if len(u) != 97 { + if len(u) != 101 { t.Errorf("invalid verbose usage, out of date? %d", len(u)) } for _, usage := range u { diff --git a/internal/app/help/doc/toml.txt b/internal/app/help/doc/toml.txt @@ -1,7 +1,11 @@ The core components of `{{ $.Executable }}` are controlled via -TOML configuration file(s). Run `{{ $.Executable }} {{ $.HelpCommand }} {{ $.HelpConfigCommand -}}` for more information. +TOML configuration file(s). The configuration can be specifically +set via `{{ $.Config.Env }}=...`, detected/found in HOME ({{ $.Config.Home }}), +or detected/found in XDG_CONFIG_HOME ({{ $.Config.XDG }}). - Arrays defined within the TOML configuration are flattened into a string (space delimited), quoting should be done within array parameters when needed. + +- Run `{{ $.Executable }} {{ $.HelpCommand }} {{ $.HelpConfigCommand +}}` for more information.