diff --git a/README.md b/README.md index 4164295..6ec65af 100644 --- a/README.md +++ b/README.md @@ -175,11 +175,11 @@ pda get name --exists `pda mv` to move it. ```bash pda mv name name2 -# ok renamed name to name2 +# ok renamed name to name2 # --safe to skip if the destination already exists. pda mv name name2 --safe -# info skipped 'name2': already exists +# info skipped 'name2': already exists # --yes/-y to skip confirmation prompts. pda mv name name2 -y @@ -210,8 +210,8 @@ pda rm kitty --key "?og" # Opt in to a confirmation prompt with --interactive/-i (or always_prompt_delete in config). pda rm kitty -i -# ??? remove 'kitty'? (y/n) -# ==> y +# ??? remove 'kitty'? (y/n) +# ==> y # --yes/-y to auto-accept all confirmation prompts. pda rm kitty -y @@ -283,11 +283,11 @@ pda export --value "**https**" ```bash # Entries are routed to their original stores. pda import -f my_backup -# ok restored 5 entries +# ok restored 5 entries # Force all entries into a specific store by passing a store name. pda import mystore -f my_backup -# ok restored 5 entries into @mystore +# ok restored 5 entries into @mystore # Or from stdin. pda import < my_backup @@ -322,8 +322,8 @@ pda list-stores --short # Check out a specific store. pda ls @birthdays --no-header --no-ttl -# alice 11/11/1998 -# bob 05/12/1980 +# alice 11/11/1998 +# bob 05/12/1980 # Export it. pda export birthdays > friends_birthdays @@ -427,7 +427,7 @@ pda get greeting NAME="Bob" ```bash pda set file "{{ require .FILE }}" pda get file -# FAIL cannot get 'file': ...required value is missing or empty +# FAIL cannot get 'file': ...required value is missing or empty ```
@@ -447,7 +447,7 @@ pda set level "Log level: {{ enum .LEVEL "info" "warn" "error" }}" pda get level LEVEL=info # Log level: info pda get level LEVEL=debug -# FAIL cannot get 'level': ...invalid value 'debug', allowed: [info warn error] +# FAIL cannot get 'level': ...invalid value 'debug', allowed: [info warn error] ``` @@ -601,9 +601,9 @@ pda ls --value "**world**" --value "42" Globs can be arbitrarily complex, and `--key` can be combined with exact positional args on `rm`. ```bash pda rm cat --key "{mouse,[cd]og}**" -# ??? remove 'cat'? (y/n) -# ==> y -# ??? remove 'mouse trap'? (y/n) +# ??? remove 'cat'? (y/n) +# ==> y +# ??? remove 'mouse trap'? (y/n) # ... ``` @@ -679,7 +679,7 @@ pda export ```bash pda set --encrypt api-key "sk-live-abc123" -# ok created identity at ~/.config/pda/identity.txt +# ok created identity at ~/.config/pda/identity.txt pda set --encrypt token "ghp_xxxx" ``` @@ -708,8 +708,8 @@ pda cp api-key api-key-backup # still encrypted pda set api-key "oops" -# WARN overwriting encrypted key 'api-key' as plaintext -# hint pass --encrypt to keep it encrypted +# WARN overwriting encrypted key 'api-key' as plaintext +# hint pass --encrypt to keep it encrypted ``` @@ -721,7 +721,7 @@ pda ls # api-key locked (identity file missing) no expiry pda get api-key -# FAIL cannot get 'api-key': secret is locked (identity file missing) +# FAIL cannot get 'api-key': secret is locked (identity file missing) ``` @@ -729,8 +729,8 @@ pda get api-key `pda identity` to see your public key and identity file path. ```bash pda identity -# ok pubkey age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p -# ok identity ~/.config/pda/identity.txt +# ok pubkey age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p +# ok identity ~/.config/pda/identity.txt # Just the path. pda identity --path @@ -748,22 +748,22 @@ pda identity --new ```bash pda doctor -# ok pda! 2025.52 Christmas release (linux/amd64) -# ok OS: Linux 6.18.7-arch1-1 -# ok Go: go1.23.0 -# ok Git: 2.45.0 -# ok Shell: /bin/zsh -# ok Config: /home/user/.config/pda -# ok Non-default config: -# ├── display_ascii_art: false -# └── git.auto_commit: true -# ok Data: /home/user/.local/share/pda -# ok Identity: /home/user/.config/pda/identity.txt -# ok Git initialised on main -# ok Git remote configured -# ok Git in sync with remote -# ok 3 store(s), 15 key(s), 2 secret(s), 4.2k total -# ok No issues found +# ok pda! 2025.52 Christmas release (linux/amd64) +# ok OS: Linux 6.18.7-arch1-1 +# ok Go: go1.23.0 +# ok Git: 2.45.0 +# ok Shell: /bin/zsh +# ok Config: /home/user/.config/pda +# ok Non-default config: +# ├── display_ascii_art: false +# └── git.auto_commit: true +# ok Data: /home/user/.local/share/pda +# ok Identity: /home/user/.config/pda/identity.txt +# ok Git initialised on main +# ok Git remote configured +# ok Git in sync with remote +# ok 3 store(s), 15 key(s), 2 secret(s), 4.2k total size +# ok No issues found ``` diff --git a/cmd/config_fields.go b/cmd/config_fields.go index 5b94f79..f65f122 100644 --- a/cmd/config_fields.go +++ b/cmd/config_fields.go @@ -2,6 +2,7 @@ package cmd import ( "reflect" + "strings" "github.com/agnivade/levenshtein" ) @@ -69,16 +70,36 @@ func findConfigField(fields []ConfigField, key string) *ConfigField { return nil } -// suggestConfigKey returns Levenshtein-based suggestions for a mistyped config key. +// suggestConfigKey returns suggestions for a mistyped config key. More generous +// than key/store suggestions since the config key space is small (~11 keys). +// Normalises spaces to underscores and matches against both the full dotted key +// and the leaf segment (part after the last dot). func suggestConfigKey(fields []ConfigField, target string) []string { - minThreshold := 1 - maxThreshold := 4 - threshold := min(max(len(target)/3, minThreshold), maxThreshold) + normalized := strings.ReplaceAll(target, " ", "_") var suggestions []string for _, f := range fields { - if levenshtein.ComputeDistance(target, f.Key) <= threshold { + if matchesConfigKey(normalized, f.Key) { suggestions = append(suggestions, f.Key) } } return suggestions } + +func matchesConfigKey(input, key string) bool { + // Substring match (either direction) + if strings.Contains(key, input) || strings.Contains(input, key) { + return true + } + // Levenshtein against full dotted key + if levenshtein.ComputeDistance(input, key) <= max(len(key)/3, 4) { + return true + } + // Levenshtein against leaf segment + if i := strings.LastIndex(key, "."); i >= 0 { + leaf := key[i+1:] + if levenshtein.ComputeDistance(input, leaf) <= max(len(leaf)/3, 1) { + return true + } + } + return false +} diff --git a/cmd/doctor.go b/cmd/doctor.go index 6ac28df..56dfdc3 100644 --- a/cmd/doctor.go +++ b/cmd/doctor.go @@ -49,7 +49,7 @@ func runDoctor(w io.Writer) bool { code = "31" hasError = true } - fmt.Fprintf(w, "%s %s\n", keyword(code, level, tty), msg) + fmt.Fprintf(w, "%s %s\n", keyword(code, level, tty), msg) } tree := func(items []string) { @@ -279,7 +279,7 @@ func runDoctor(w io.Writer) bool { if parseErrors > 0 { emit("FAIL", fmt.Sprintf("%d store(s), %d with parse errors", len(stores), parseErrors)) } else { - emit("ok", fmt.Sprintf("%d store(s), %d key(s), %d secret(s), %s total", + emit("ok", fmt.Sprintf("%d store(s), %d key(s), %d secret(s), %s total size", len(stores), totalKeys, totalSecrets, formatSize(int(totalSize)))) } } diff --git a/cmd/msg.go b/cmd/msg.go index c850b81..ea1d7d6 100644 --- a/cmd/msg.go +++ b/cmd/msg.go @@ -48,41 +48,41 @@ func keyword(code, word string, tty bool) string { } func printError(err error) { - fmt.Fprintf(os.Stderr, "%s %s\n", keyword("31", "FAIL", stderrIsTerminal()), err) + fmt.Fprintf(os.Stderr, "%s %s\n", keyword("31", "FAIL", stderrIsTerminal()), err) } func printHint(format string, args ...any) { msg := fmt.Sprintf(format, args...) - fmt.Fprintf(os.Stderr, "%s %s\n", keyword("2", "hint", stderrIsTerminal()), msg) + fmt.Fprintf(os.Stderr, "%s %s\n", keyword("2", "hint", stderrIsTerminal()), msg) } func warnf(format string, args ...any) { msg := fmt.Sprintf(format, args...) - fmt.Fprintf(os.Stderr, "%s %s\n", keyword("33", "WARN", stderrIsTerminal()), msg) + fmt.Fprintf(os.Stderr, "%s %s\n", keyword("33", "WARN", stderrIsTerminal()), msg) } func infof(format string, args ...any) { msg := fmt.Sprintf(format, args...) - fmt.Fprintf(os.Stderr, "%s %s\n", keyword("34", "info", stderrIsTerminal()), msg) + fmt.Fprintf(os.Stderr, "%s %s\n", keyword("34", "info", stderrIsTerminal()), msg) } func okf(format string, args ...any) { msg := fmt.Sprintf(format, args...) - fmt.Fprintf(os.Stderr, "%s %s\n", keyword("32", "ok", stderrIsTerminal()), msg) + fmt.Fprintf(os.Stderr, "%s %s\n", keyword("32", "ok", stderrIsTerminal()), msg) } func promptf(format string, args ...any) { msg := fmt.Sprintf(format, args...) - fmt.Fprintf(os.Stdout, "%s %s\n", keyword("36", "???", stdoutIsTerminal()), msg) + fmt.Fprintf(os.Stdout, "%s %s\n", keyword("36", "???", stdoutIsTerminal()), msg) } func progressf(format string, args ...any) { msg := fmt.Sprintf(format, args...) - fmt.Fprintf(os.Stdout, "%s %s\n", keyword("2", ">", stdoutIsTerminal()), msg) + fmt.Fprintf(os.Stdout, "%s %s\n", keyword("2", ">", stdoutIsTerminal()), msg) } func scanln(dest *string) error { - fmt.Fprintf(os.Stdout, "%s ", keyword("2", "==>", stdoutIsTerminal())) + fmt.Fprintf(os.Stdout, "%s ", keyword("2", "==>", stdoutIsTerminal())) _, err := fmt.Scanln(dest) return err } diff --git a/testdata/config-get.ct b/testdata/config-get.ct index a4e7f4e..1ca3e65 100644 --- a/testdata/config-get.ct +++ b/testdata/config-get.ct @@ -7,7 +7,12 @@ default $ pda config get git.auto_commit false -# Unknown key with suggestion +# Unknown key with suggestion (typo) $ pda config get git.auto_comit --> FAIL -FAIL unknown config key 'git.auto_comit' -hint did you mean 'git.auto_commit'? +FAIL unknown config key 'git.auto_comit' +hint did you mean 'git.auto_commit'? + +# Unknown key with suggestion (leaf match, no prefix) +$ pda config get auto_commit --> FAIL +FAIL unknown config key 'auto_commit' +hint did you mean 'git.auto_commit'? diff --git a/testdata/config-init.ct b/testdata/config-init.ct index 2b36536..20539f3 100644 --- a/testdata/config-init.ct +++ b/testdata/config-init.ct @@ -3,8 +3,8 @@ $ pda config init # Second init fails $ pda config init --> FAIL -FAIL config file already exists -hint use 'pda config edit' or 'pda config init --new' +FAIL config file already exists +hint use 'pda config edit' or 'pda config init --new' # Init --new overwrites $ pda config init --new diff --git a/testdata/cp-cross-store.ct b/testdata/cp-cross-store.ct index 1d94f54..ee2d8ea 100644 --- a/testdata/cp-cross-store.ct +++ b/testdata/cp-cross-store.ct @@ -1,7 +1,7 @@ # Cross-store copy $ pda set key@src value $ pda cp key@src key@dst - ok copied key@src to key@dst + ok copied key@src to key@dst $ pda get key@src value $ pda get key@dst diff --git a/testdata/cp-encrypt.ct b/testdata/cp-encrypt.ct index 7512f52..7686f8e 100644 --- a/testdata/cp-encrypt.ct +++ b/testdata/cp-encrypt.ct @@ -1,7 +1,7 @@ # Copy an encrypted key; both keys should decrypt. $ pda set --encrypt secret-key@cpe hidden-value $ pda cp secret-key@cpe copied-key@cpe - ok copied secret-key@cpe to copied-key@cpe + ok copied secret-key@cpe to copied-key@cpe $ pda get secret-key@cpe hidden-value $ pda get copied-key@cpe diff --git a/testdata/cp-missing-err.ct b/testdata/cp-missing-err.ct index d152d13..73e403e 100644 --- a/testdata/cp-missing-err.ct +++ b/testdata/cp-missing-err.ct @@ -1,3 +1,3 @@ # Copy non-existent key $ pda cp nonexistent dest --> FAIL -FAIL cannot move 'nonexistent': no such key +FAIL cannot move 'nonexistent': no such key diff --git a/testdata/cp-safe.ct b/testdata/cp-safe.ct index 0a46ca8..b4b057f 100644 --- a/testdata/cp-safe.ct +++ b/testdata/cp-safe.ct @@ -1,6 +1,6 @@ $ pda set src@csf hello $ pda set dst@csf existing $ pda cp src@csf dst@csf --safe -info skipped 'dst@csf': already exists +info skipped 'dst@csf': already exists $ pda get dst@csf existing diff --git a/testdata/cp.ct b/testdata/cp.ct index 0a7096c..92d18b4 100644 --- a/testdata/cp.ct +++ b/testdata/cp.ct @@ -1,7 +1,7 @@ # Basic copy $ pda set source@cpok value $ pda cp source@cpok dest@cpok - ok copied source@cpok to dest@cpok + ok copied source@cpok to dest@cpok $ pda get source@cpok value $ pda get dest@cpok diff --git a/testdata/export-key-filter.ct b/testdata/export-key-filter.ct index d9e3cdf..4bc3759 100644 --- a/testdata/export-key-filter.ct +++ b/testdata/export-key-filter.ct @@ -5,4 +5,4 @@ $ pda export ekf --key "a*" {"key":"a1","value":"1","encoding":"text","store":"ekf"} {"key":"a2","value":"2","encoding":"text","store":"ekf"} $ pda export ekf --key "c*" --> FAIL -FAIL cannot ls '@ekf': no matches for key pattern 'c*' +FAIL cannot ls '@ekf': no matches for key pattern 'c*' diff --git a/testdata/get-invalid-store-err.ct b/testdata/get-invalid-store-err.ct index 973d83b..7c93ff2 100644 --- a/testdata/get-invalid-store-err.ct +++ b/testdata/get-invalid-store-err.ct @@ -1,2 +1,2 @@ $ pda get key@foo/bar --> FAIL -FAIL cannot get 'key@foo/bar': bad store format, use STORE or @STORE +FAIL cannot get 'key@foo/bar': bad store format, use STORE or @STORE diff --git a/testdata/get-missing-all-flags-err.ct b/testdata/get-missing-all-flags-err.ct index b4fe45a..55891a5 100644 --- a/testdata/get-missing-all-flags-err.ct +++ b/testdata/get-missing-all-flags-err.ct @@ -5,10 +5,10 @@ $ pda get foobar --base64 --run --secret --> FAIL $ pda get foobar --run --> FAIL $ pda get foobar --run --secret --> FAIL $ pda get foobar --secret --> FAIL -FAIL cannot get 'foobar': no such key -FAIL cannot get 'foobar': no such key -FAIL cannot get 'foobar': no such key -FAIL unknown flag: --secret -FAIL cannot get 'foobar': no such key -FAIL unknown flag: --secret -FAIL unknown flag: --secret +FAIL cannot get 'foobar': no such key +FAIL cannot get 'foobar': no such key +FAIL cannot get 'foobar': no such key +FAIL unknown flag: --secret +FAIL cannot get 'foobar': no such key +FAIL unknown flag: --secret +FAIL unknown flag: --secret diff --git a/testdata/get-missing-err.ct b/testdata/get-missing-err.ct index b528954..20b7acf 100644 --- a/testdata/get-missing-err.ct +++ b/testdata/get-missing-err.ct @@ -1,2 +1,2 @@ $ pda get foobar --> FAIL -FAIL cannot get 'foobar': no such key +FAIL cannot get 'foobar': no such key diff --git a/testdata/import-drop.ct b/testdata/import-drop.ct index 3422eab..4466ad1 100644 --- a/testdata/import-drop.ct +++ b/testdata/import-drop.ct @@ -2,8 +2,8 @@ $ pda set existing@idr keep-me $ pda set other@idr also-keep $ fecho dumpfile {"key":"new","value":"hello","encoding":"text"} $ pda import idr --drop --file dumpfile - ok restored 1 entries into @idr + ok restored 1 entries into @idr $ pda get new@idr hello $ pda get existing@idr --> FAIL -FAIL cannot get 'existing@idr': no such key +FAIL cannot get 'existing@idr': no such key diff --git a/testdata/import-key-filter.ct b/testdata/import-key-filter.ct index 5a5cffb..98258df 100644 --- a/testdata/import-key-filter.ct +++ b/testdata/import-key-filter.ct @@ -4,13 +4,13 @@ $ pda set b1@ikf 3 $ fecho dumpfile {"key":"a1","value":"1","encoding":"text"} {"key":"a2","value":"2","encoding":"text"} {"key":"b1","value":"3","encoding":"text"} $ pda rm a1@ikf a2@ikf b1@ikf $ pda import ikf --key "a*" --file dumpfile - ok restored 2 entries into @ikf + ok restored 2 entries into @ikf $ pda get a1@ikf 1 $ pda get a2@ikf 2 $ pda get b1@ikf --> FAIL -FAIL cannot get 'b1@ikf': no such key -hint did you mean 'a1'? +FAIL cannot get 'b1@ikf': no such key +hint did you mean 'a1'? $ pda import ikf --key "c*" --file dumpfile --> FAIL -FAIL cannot restore '@ikf': no matches for key pattern 'c*' +FAIL cannot restore '@ikf': no matches for key pattern 'c*' diff --git a/testdata/import-merge.ct b/testdata/import-merge.ct index 4c81265..7a66e5f 100644 --- a/testdata/import-merge.ct +++ b/testdata/import-merge.ct @@ -2,7 +2,7 @@ $ pda set existing@mrg old-value $ fecho dumpfile {"key":"existing","value":"updated","encoding":"text"} {"key":"new","value":"hello","encoding":"text"} $ pda import mrg --file dumpfile - ok restored 2 entries into @mrg + ok restored 2 entries into @mrg $ pda get existing@mrg updated $ pda get new@mrg diff --git a/testdata/import-stdin.ct b/testdata/import-stdin.ct index f120052..18383c5 100644 --- a/testdata/import-stdin.ct +++ b/testdata/import-stdin.ct @@ -2,7 +2,7 @@ $ pda set existing@stn keep-me $ fecho dumpfile {"key":"new","value":"hello","encoding":"text"} $ pda import stn < dumpfile - ok restored 1 entries into @stn + ok restored 1 entries into @stn $ pda get existing@stn keep-me $ pda get new@stn diff --git a/testdata/invalid-command-err.ct b/testdata/invalid-command-err.ct index 93359ea..d39ba9c 100644 --- a/testdata/invalid-command-err.ct +++ b/testdata/invalid-command-err.ct @@ -1,2 +1,2 @@ $ pda invalidcmd --> FAIL -FAIL unknown command "invalidcmd" for "pda" +FAIL unknown command "invalidcmd" for "pda" diff --git a/testdata/list-all-suppressed-err.ct b/testdata/list-all-suppressed-err.ct index f96a22b..432e144 100644 --- a/testdata/list-all-suppressed-err.ct +++ b/testdata/list-all-suppressed-err.ct @@ -1,5 +1,5 @@ # Error when all columns are suppressed $ pda set a@las 1 $ pda ls las --no-keys --no-values --no-ttl --> FAIL -FAIL cannot ls '@las': no columns selected -hint disable --no-keys, --no-values, or --no-ttl +FAIL cannot ls '@las': no columns selected +hint disable --no-keys, --no-values, or --no-ttl diff --git a/testdata/list-all.ct b/testdata/list-all.ct index 2adf6f3..1694b4f 100644 --- a/testdata/list-all.ct +++ b/testdata/list-all.ct @@ -23,7 +23,7 @@ Key Store Value TTL lax laa 1 no expiry # --store cannot be combined with positional arg $ pda ls --store "laa" laa --> FAIL -FAIL cannot use --store with a store argument +FAIL cannot use --store with a store argument # --store no matches $ pda ls --store "nonexistent" --key "lax" --> FAIL -FAIL cannot ls 'all': no matches for key pattern 'lax' and store pattern 'nonexistent' +FAIL cannot ls 'all': no matches for key pattern 'lax' and store pattern 'nonexistent' diff --git a/testdata/list-invalid-store-err.ct b/testdata/list-invalid-store-err.ct index 0a90ecb..eaf1a60 100644 --- a/testdata/list-invalid-store-err.ct +++ b/testdata/list-invalid-store-err.ct @@ -1,2 +1,2 @@ $ pda ls foo/bar --> FAIL -FAIL cannot ls 'foo/bar': cannot parse store: bad store format, use STORE or @STORE +FAIL cannot ls 'foo/bar': cannot parse store: bad store format, use STORE or @STORE diff --git a/testdata/list-key-filter.ct b/testdata/list-key-filter.ct index 7f8e8b2..d10e229 100644 --- a/testdata/list-key-filter.ct +++ b/testdata/list-key-filter.ct @@ -9,4 +9,4 @@ $ pda ls lg --key "b*" --format tsv Key Store Value TTL b1 lg 3 no expiry $ pda ls lg --key "c*" --> FAIL -FAIL cannot ls '@lg': no matches for key pattern 'c*' +FAIL cannot ls '@lg': no matches for key pattern 'c*' diff --git a/testdata/list-key-value-filter.ct b/testdata/list-key-value-filter.ct index 2ffdbc4..5fde71a 100644 --- a/testdata/list-key-value-filter.ct +++ b/testdata/list-key-value-filter.ct @@ -8,4 +8,4 @@ $ pda ls kv -k "*url*" -v "**example**" --format tsv Key Store Value TTL apiurl kv https://api.example.com no expiry $ pda ls kv -k "db*" -v "**nomatch**" --> FAIL -FAIL cannot ls '@kv': no matches for key pattern 'db*' and value pattern '**nomatch**' +FAIL cannot ls '@kv': no matches for key pattern 'db*' and value pattern '**nomatch**' diff --git a/testdata/list-value-filter.ct b/testdata/list-value-filter.ct index dae1dbd..0e29856 100644 --- a/testdata/list-value-filter.ct +++ b/testdata/list-value-filter.ct @@ -12,4 +12,4 @@ $ pda ls vt --value "*" --format tsv Key Store Value TTL number vt 42 no expiry $ pda ls vt --value "**nomatch**" --> FAIL -FAIL cannot ls '@vt': no matches for value pattern '**nomatch**' +FAIL cannot ls '@vt': no matches for value pattern '**nomatch**' diff --git a/testdata/mv-cross-store.ct b/testdata/mv-cross-store.ct index a604178..2e43987 100644 --- a/testdata/mv-cross-store.ct +++ b/testdata/mv-cross-store.ct @@ -1,8 +1,8 @@ # Cross-store move $ pda set key@src value $ pda mv key@src key@dst - ok renamed key@src to key@dst + ok renamed key@src to key@dst $ pda get key@dst value $ pda get key@src --> FAIL -FAIL cannot get 'key@src': no such key +FAIL cannot get 'key@src': no such key diff --git a/testdata/mv-encrypt.ct b/testdata/mv-encrypt.ct index df03f91..99ae9aa 100644 --- a/testdata/mv-encrypt.ct +++ b/testdata/mv-encrypt.ct @@ -1,8 +1,8 @@ # Move an encrypted key; the new key should still decrypt. $ pda set --encrypt secret-key@mve hidden-value $ pda mv secret-key@mve moved-key@mve - ok renamed secret-key@mve to moved-key@mve + ok renamed secret-key@mve to moved-key@mve $ pda get moved-key@mve hidden-value $ pda get secret-key@mve --> FAIL -FAIL cannot get 'secret-key@mve': no such key +FAIL cannot get 'secret-key@mve': no such key diff --git a/testdata/mv-missing-err.ct b/testdata/mv-missing-err.ct index 6df2ff0..9267bc0 100644 --- a/testdata/mv-missing-err.ct +++ b/testdata/mv-missing-err.ct @@ -1,3 +1,3 @@ # Move non-existent key $ pda mv nonexistent dest --> FAIL -FAIL cannot move 'nonexistent': no such key +FAIL cannot move 'nonexistent': no such key diff --git a/testdata/mv-safe.ct b/testdata/mv-safe.ct index 0213ada..98cf125 100644 --- a/testdata/mv-safe.ct +++ b/testdata/mv-safe.ct @@ -1,7 +1,7 @@ $ pda set src@msf hello $ pda set dst@msf existing $ pda mv src@msf dst@msf --safe -info skipped 'dst@msf': already exists +info skipped 'dst@msf': already exists $ pda get src@msf hello $ pda get dst@msf diff --git a/testdata/mv-store-copy.ct b/testdata/mv-store-copy.ct index 5ef049a..618396a 100644 --- a/testdata/mv-store-copy.ct +++ b/testdata/mv-store-copy.ct @@ -1,6 +1,6 @@ $ pda set key@msc1 value $ pda move-store msc1 msc2 --copy - ok copied @msc1 to @msc2 + ok copied @msc1 to @msc2 $ pda get key@msc1 value $ pda get key@msc2 diff --git a/testdata/mv-store-missing-err.ct b/testdata/mv-store-missing-err.ct index b42fbe3..cb4baa0 100644 --- a/testdata/mv-store-missing-err.ct +++ b/testdata/mv-store-missing-err.ct @@ -1,2 +1,2 @@ $ pda move-store nonexistent dest --> FAIL -FAIL cannot rename store 'nonexistent': no such store +FAIL cannot rename store 'nonexistent': no such store diff --git a/testdata/mv-store-safe.ct b/testdata/mv-store-safe.ct index 20e5e3e..3415aba 100644 --- a/testdata/mv-store-safe.ct +++ b/testdata/mv-store-safe.ct @@ -1,7 +1,7 @@ $ pda set a@mssf1 1 $ pda set b@mssf2 2 $ pda move-store mssf1 mssf2 --safe -info skipped '@mssf2': already exists +info skipped '@mssf2': already exists $ pda get a@mssf1 1 $ pda get b@mssf2 diff --git a/testdata/mv-store-same-err.ct b/testdata/mv-store-same-err.ct index 11013b2..d7f0c6b 100644 --- a/testdata/mv-store-same-err.ct +++ b/testdata/mv-store-same-err.ct @@ -1,3 +1,3 @@ $ pda set a@mss same $ pda move-store mss mss --> FAIL -FAIL cannot rename store 'mss': source and destination are the same +FAIL cannot rename store 'mss': source and destination are the same diff --git a/testdata/mv-store.ct b/testdata/mv-store.ct index c3b1cc0..7ae0855 100644 --- a/testdata/mv-store.ct +++ b/testdata/mv-store.ct @@ -1,5 +1,5 @@ $ pda set key@mvs1 value $ pda move-store mvs1 mvs2 - ok renamed @mvs1 to @mvs2 + ok renamed @mvs1 to @mvs2 $ pda get key@mvs2 value diff --git a/testdata/mv.ct b/testdata/mv.ct index d2036e0..3679ffd 100644 --- a/testdata/mv.ct +++ b/testdata/mv.ct @@ -1,8 +1,8 @@ # Basic move $ pda set source@mvok value $ pda mv source@mvok dest@mvok - ok renamed source@mvok to dest@mvok + ok renamed source@mvok to dest@mvok $ pda get dest@mvok value $ pda get source@mvok --> FAIL -FAIL cannot get 'source@mvok': no such key +FAIL cannot get 'source@mvok': no such key diff --git a/testdata/remove-dedupe.ct b/testdata/remove-dedupe.ct index d7c1245..6f8fe32 100644 --- a/testdata/remove-dedupe.ct +++ b/testdata/remove-dedupe.ct @@ -7,6 +7,6 @@ bar rdd 2 no expiry foo rdd 1 no expiry $ pda rm foo@rdd --key "*@rdd" -y $ pda get bar@rdd --> FAIL -FAIL cannot get 'bar@rdd': no such key +FAIL cannot get 'bar@rdd': no such key $ pda get foo@rdd --> FAIL -FAIL cannot get 'foo@rdd': no such key +FAIL cannot get 'foo@rdd': no such key diff --git a/testdata/remove-key-glob.ct b/testdata/remove-key-glob.ct index fed822d..84b90d0 100644 --- a/testdata/remove-key-glob.ct +++ b/testdata/remove-key-glob.ct @@ -3,9 +3,9 @@ $ pda set a2@rkg 2 $ pda set b1@rkg 3 $ pda rm --key "a*@rkg" -y $ pda get a1@rkg --> FAIL -FAIL cannot get 'a1@rkg': no such key -hint did you mean 'b1'? +FAIL cannot get 'a1@rkg': no such key +hint did you mean 'b1'? $ pda get a2@rkg --> FAIL -FAIL cannot get 'a2@rkg': no such key +FAIL cannot get 'a2@rkg': no such key $ pda get b1@rkg 3 diff --git a/testdata/remove-key-mixed.ct b/testdata/remove-key-mixed.ct index 49b7299..638e136 100644 --- a/testdata/remove-key-mixed.ct +++ b/testdata/remove-key-mixed.ct @@ -3,8 +3,8 @@ $ pda set bar1@rkm 2 $ pda set bar2@rkm 3 $ pda rm foo@rkm --key "bar*@rkm" -y $ pda get foo@rkm --> FAIL -FAIL cannot get 'foo@rkm': no such key +FAIL cannot get 'foo@rkm': no such key $ pda get bar1@rkm --> FAIL -FAIL cannot get 'bar1@rkm': no such key +FAIL cannot get 'bar1@rkm': no such key $ pda get bar2@rkm --> FAIL -FAIL cannot get 'bar2@rkm': no such key +FAIL cannot get 'bar2@rkm': no such key diff --git a/testdata/remove-multiple.ct b/testdata/remove-multiple.ct index e54d533..2c2fa89 100644 --- a/testdata/remove-multiple.ct +++ b/testdata/remove-multiple.ct @@ -2,6 +2,6 @@ $ pda set a@rmm 1 $ pda set b@rmm 2 $ pda rm a@rmm b@rmm $ pda get a@rmm --> FAIL -FAIL cannot get 'a@rmm': no such key +FAIL cannot get 'a@rmm': no such key $ pda get b@rmm --> FAIL -FAIL cannot get 'b@rmm': no such key +FAIL cannot get 'b@rmm': no such key diff --git a/testdata/remove-store-invalid-err.ct b/testdata/remove-store-invalid-err.ct index 6750010..fcdda4b 100644 --- a/testdata/remove-store-invalid-err.ct +++ b/testdata/remove-store-invalid-err.ct @@ -1,2 +1,2 @@ $ pda rms foo/bar --> FAIL -FAIL cannot delete store 'foo/bar': cannot parse store: bad store format, use STORE or @STORE +FAIL cannot delete store 'foo/bar': cannot parse store: bad store format, use STORE or @STORE diff --git a/testdata/remove-yes.ct b/testdata/remove-yes.ct index 7d2b8e0..10e3650 100644 --- a/testdata/remove-yes.ct +++ b/testdata/remove-yes.ct @@ -2,7 +2,7 @@ $ pda set a@ry "1" $ pda set b@ry "2" $ pda rm a@ry -i -y $ pda get a@ry --> FAIL -FAIL cannot get 'a@ry': no such key -hint did you mean 'b'? +FAIL cannot get 'a@ry': no such key +hint did you mean 'b'? $ pda get b@ry "2" diff --git a/testdata/set-file-conflict-err.ct b/testdata/set-file-conflict-err.ct index 19ecd17..f8a971e 100644 --- a/testdata/set-file-conflict-err.ct +++ b/testdata/set-file-conflict-err.ct @@ -1,3 +1,3 @@ $ fecho myfile contents $ pda set key@sfc value --file myfile --> FAIL -FAIL cannot set 'key@sfc': --file and VALUE argument are mutually exclusive +FAIL cannot set 'key@sfc': --file and VALUE argument are mutually exclusive diff --git a/testdata/set-invalid-ttl-err.ct b/testdata/set-invalid-ttl-err.ct index 9a33eef..781623b 100644 --- a/testdata/set-invalid-ttl-err.ct +++ b/testdata/set-invalid-ttl-err.ct @@ -1,2 +1,2 @@ $ pda set a b --ttl 3343r --> FAIL -FAIL invalid argument "3343r" for "-t, --ttl" flag: time: unknown unit "r" in duration "3343r" +FAIL invalid argument "3343r" for "-t, --ttl" flag: time: unknown unit "r" in duration "3343r" diff --git a/testdata/set-safe.ct b/testdata/set-safe.ct index 8755d20..9a08cb7 100644 --- a/testdata/set-safe.ct +++ b/testdata/set-safe.ct @@ -2,7 +2,7 @@ $ pda set key@ss "original" --safe $ pda get key@ss "original" $ pda set key@ss "overwritten" --safe -info skipped 'key@ss': already exists +info skipped 'key@ss': already exists $ pda get key@ss "original" $ pda set newkey@ss "fresh" --safe diff --git a/testdata/template-enum-err.ct b/testdata/template-enum-err.ct index e2b9f1f..f3a5e79 100644 --- a/testdata/template-enum-err.ct +++ b/testdata/template-enum-err.ct @@ -2,4 +2,4 @@ $ fecho tpl {{ enum .LEVEL "info" "warn" }} $ pda set level@tple < tpl $ pda get level@tple LEVEL=debug --> FAIL -FAIL cannot get 'level@tple': template: cmd:1:3: executing "cmd" at