refactor(msg): single space between keyword and message, improve config suggestions
Tightens keyword formatting (ok/FAIL/hint/etc.) from two spaces to one. Makes config key suggestions more generous: normalises spaces to underscores, matches against leaf segments, and uses substring matching. Updates all golden files.
This commit is contained in:
parent
db607ac696
commit
c9b448d508
47 changed files with 144 additions and 118 deletions
70
README.md
70
README.md
|
|
@ -175,11 +175,11 @@ pda get name --exists
|
||||||
`pda mv` to move it.
|
`pda mv` to move it.
|
||||||
```bash
|
```bash
|
||||||
pda mv name name2
|
pda mv name name2
|
||||||
# ok renamed name to name2
|
# ok renamed name to name2
|
||||||
|
|
||||||
# --safe to skip if the destination already exists.
|
# --safe to skip if the destination already exists.
|
||||||
pda mv name name2 --safe
|
pda mv name name2 --safe
|
||||||
# info skipped 'name2': already exists
|
# info skipped 'name2': already exists
|
||||||
|
|
||||||
# --yes/-y to skip confirmation prompts.
|
# --yes/-y to skip confirmation prompts.
|
||||||
pda mv name name2 -y
|
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).
|
# Opt in to a confirmation prompt with --interactive/-i (or always_prompt_delete in config).
|
||||||
pda rm kitty -i
|
pda rm kitty -i
|
||||||
# ??? remove 'kitty'? (y/n)
|
# ??? remove 'kitty'? (y/n)
|
||||||
# ==> y
|
# ==> y
|
||||||
|
|
||||||
# --yes/-y to auto-accept all confirmation prompts.
|
# --yes/-y to auto-accept all confirmation prompts.
|
||||||
pda rm kitty -y
|
pda rm kitty -y
|
||||||
|
|
@ -283,11 +283,11 @@ pda export --value "**https**"
|
||||||
```bash
|
```bash
|
||||||
# Entries are routed to their original stores.
|
# Entries are routed to their original stores.
|
||||||
pda import -f my_backup
|
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.
|
# Force all entries into a specific store by passing a store name.
|
||||||
pda import mystore -f my_backup
|
pda import mystore -f my_backup
|
||||||
# ok restored 5 entries into @mystore
|
# ok restored 5 entries into @mystore
|
||||||
|
|
||||||
# Or from stdin.
|
# Or from stdin.
|
||||||
pda import < my_backup
|
pda import < my_backup
|
||||||
|
|
@ -322,8 +322,8 @@ pda list-stores --short
|
||||||
|
|
||||||
# Check out a specific store.
|
# Check out a specific store.
|
||||||
pda ls @birthdays --no-header --no-ttl
|
pda ls @birthdays --no-header --no-ttl
|
||||||
# alice 11/11/1998
|
# alice 11/11/1998
|
||||||
# bob 05/12/1980
|
# bob 05/12/1980
|
||||||
|
|
||||||
# Export it.
|
# Export it.
|
||||||
pda export birthdays > friends_birthdays
|
pda export birthdays > friends_birthdays
|
||||||
|
|
@ -427,7 +427,7 @@ pda get greeting NAME="Bob"
|
||||||
```bash
|
```bash
|
||||||
pda set file "{{ require .FILE }}"
|
pda set file "{{ require .FILE }}"
|
||||||
pda get file
|
pda get file
|
||||||
# FAIL cannot get 'file': ...required value is missing or empty
|
# FAIL cannot get 'file': ...required value is missing or empty
|
||||||
```
|
```
|
||||||
|
|
||||||
<p align="center"></p><!-- spacer -->
|
<p align="center"></p><!-- spacer -->
|
||||||
|
|
@ -447,7 +447,7 @@ pda set level "Log level: {{ enum .LEVEL "info" "warn" "error" }}"
|
||||||
pda get level LEVEL=info
|
pda get level LEVEL=info
|
||||||
# Log level: info
|
# Log level: info
|
||||||
pda get level LEVEL=debug
|
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]
|
||||||
```
|
```
|
||||||
|
|
||||||
<p align="center"></p><!-- spacer -->
|
<p align="center"></p><!-- spacer -->
|
||||||
|
|
@ -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`.
|
Globs can be arbitrarily complex, and `--key` can be combined with exact positional args on `rm`.
|
||||||
```bash
|
```bash
|
||||||
pda rm cat --key "{mouse,[cd]og}**"
|
pda rm cat --key "{mouse,[cd]og}**"
|
||||||
# ??? remove 'cat'? (y/n)
|
# ??? remove 'cat'? (y/n)
|
||||||
# ==> y
|
# ==> y
|
||||||
# ??? remove 'mouse trap'? (y/n)
|
# ??? remove 'mouse trap'? (y/n)
|
||||||
# ...
|
# ...
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -679,7 +679,7 @@ pda export
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pda set --encrypt api-key "sk-live-abc123"
|
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"
|
pda set --encrypt token "ghp_xxxx"
|
||||||
```
|
```
|
||||||
|
|
@ -708,8 +708,8 @@ pda cp api-key api-key-backup
|
||||||
# still encrypted
|
# still encrypted
|
||||||
|
|
||||||
pda set api-key "oops"
|
pda set api-key "oops"
|
||||||
# WARN overwriting encrypted key 'api-key' as plaintext
|
# WARN overwriting encrypted key 'api-key' as plaintext
|
||||||
# hint pass --encrypt to keep it encrypted
|
# hint pass --encrypt to keep it encrypted
|
||||||
```
|
```
|
||||||
|
|
||||||
<p align="center"></p><!-- spacer -->
|
<p align="center"></p><!-- spacer -->
|
||||||
|
|
@ -721,7 +721,7 @@ pda ls
|
||||||
# api-key locked (identity file missing) no expiry
|
# api-key locked (identity file missing) no expiry
|
||||||
|
|
||||||
pda get api-key
|
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)
|
||||||
```
|
```
|
||||||
|
|
||||||
<p align="center"></p><!-- spacer -->
|
<p align="center"></p><!-- spacer -->
|
||||||
|
|
@ -729,8 +729,8 @@ pda get api-key
|
||||||
`pda identity` to see your public key and identity file path.
|
`pda identity` to see your public key and identity file path.
|
||||||
```bash
|
```bash
|
||||||
pda identity
|
pda identity
|
||||||
# ok pubkey age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
|
# ok pubkey age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p
|
||||||
# ok identity ~/.config/pda/identity.txt
|
# ok identity ~/.config/pda/identity.txt
|
||||||
|
|
||||||
# Just the path.
|
# Just the path.
|
||||||
pda identity --path
|
pda identity --path
|
||||||
|
|
@ -748,22 +748,22 @@ pda identity --new
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pda doctor
|
pda doctor
|
||||||
# ok pda! 2025.52 Christmas release (linux/amd64)
|
# ok pda! 2025.52 Christmas release (linux/amd64)
|
||||||
# ok OS: Linux 6.18.7-arch1-1
|
# ok OS: Linux 6.18.7-arch1-1
|
||||||
# ok Go: go1.23.0
|
# ok Go: go1.23.0
|
||||||
# ok Git: 2.45.0
|
# ok Git: 2.45.0
|
||||||
# ok Shell: /bin/zsh
|
# ok Shell: /bin/zsh
|
||||||
# ok Config: /home/user/.config/pda
|
# ok Config: /home/user/.config/pda
|
||||||
# ok Non-default config:
|
# ok Non-default config:
|
||||||
# ├── display_ascii_art: false
|
# ├── display_ascii_art: false
|
||||||
# └── git.auto_commit: true
|
# └── git.auto_commit: true
|
||||||
# ok Data: /home/user/.local/share/pda
|
# ok Data: /home/user/.local/share/pda
|
||||||
# ok Identity: /home/user/.config/pda/identity.txt
|
# ok Identity: /home/user/.config/pda/identity.txt
|
||||||
# ok Git initialised on main
|
# ok Git initialised on main
|
||||||
# ok Git remote configured
|
# ok Git remote configured
|
||||||
# ok Git in sync with remote
|
# ok Git in sync with remote
|
||||||
# ok 3 store(s), 15 key(s), 2 secret(s), 4.2k total
|
# ok 3 store(s), 15 key(s), 2 secret(s), 4.2k total size
|
||||||
# ok No issues found
|
# ok No issues found
|
||||||
```
|
```
|
||||||
|
|
||||||
<p align="center"></p><!-- spacer -->
|
<p align="center"></p><!-- spacer -->
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/agnivade/levenshtein"
|
"github.com/agnivade/levenshtein"
|
||||||
)
|
)
|
||||||
|
|
@ -69,16 +70,36 @@ func findConfigField(fields []ConfigField, key string) *ConfigField {
|
||||||
return nil
|
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 {
|
func suggestConfigKey(fields []ConfigField, target string) []string {
|
||||||
minThreshold := 1
|
normalized := strings.ReplaceAll(target, " ", "_")
|
||||||
maxThreshold := 4
|
|
||||||
threshold := min(max(len(target)/3, minThreshold), maxThreshold)
|
|
||||||
var suggestions []string
|
var suggestions []string
|
||||||
for _, f := range fields {
|
for _, f := range fields {
|
||||||
if levenshtein.ComputeDistance(target, f.Key) <= threshold {
|
if matchesConfigKey(normalized, f.Key) {
|
||||||
suggestions = append(suggestions, f.Key)
|
suggestions = append(suggestions, f.Key)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return suggestions
|
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
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ func runDoctor(w io.Writer) bool {
|
||||||
code = "31"
|
code = "31"
|
||||||
hasError = true
|
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) {
|
tree := func(items []string) {
|
||||||
|
|
@ -279,7 +279,7 @@ func runDoctor(w io.Writer) bool {
|
||||||
if parseErrors > 0 {
|
if parseErrors > 0 {
|
||||||
emit("FAIL", fmt.Sprintf("%d store(s), %d with parse errors", len(stores), parseErrors))
|
emit("FAIL", fmt.Sprintf("%d store(s), %d with parse errors", len(stores), parseErrors))
|
||||||
} else {
|
} 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))))
|
len(stores), totalKeys, totalSecrets, formatSize(int(totalSize))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
cmd/msg.go
16
cmd/msg.go
|
|
@ -48,41 +48,41 @@ func keyword(code, word string, tty bool) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func printError(err error) {
|
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) {
|
func printHint(format string, args ...any) {
|
||||||
msg := fmt.Sprintf(format, args...)
|
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) {
|
func warnf(format string, args ...any) {
|
||||||
msg := fmt.Sprintf(format, args...)
|
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) {
|
func infof(format string, args ...any) {
|
||||||
msg := fmt.Sprintf(format, args...)
|
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) {
|
func okf(format string, args ...any) {
|
||||||
msg := fmt.Sprintf(format, args...)
|
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) {
|
func promptf(format string, args ...any) {
|
||||||
msg := fmt.Sprintf(format, args...)
|
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) {
|
func progressf(format string, args ...any) {
|
||||||
msg := fmt.Sprintf(format, args...)
|
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 {
|
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)
|
_, err := fmt.Scanln(dest)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
testdata/config-get.ct
vendored
11
testdata/config-get.ct
vendored
|
|
@ -7,7 +7,12 @@ default
|
||||||
$ pda config get git.auto_commit
|
$ pda config get git.auto_commit
|
||||||
false
|
false
|
||||||
|
|
||||||
# Unknown key with suggestion
|
# Unknown key with suggestion (typo)
|
||||||
$ pda config get git.auto_comit --> FAIL
|
$ pda config get git.auto_comit --> FAIL
|
||||||
FAIL unknown config key 'git.auto_comit'
|
FAIL unknown config key 'git.auto_comit'
|
||||||
hint did you mean 'git.auto_commit'?
|
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'?
|
||||||
|
|
|
||||||
4
testdata/config-init.ct
vendored
4
testdata/config-init.ct
vendored
|
|
@ -3,8 +3,8 @@ $ pda config init
|
||||||
|
|
||||||
# Second init fails
|
# Second init fails
|
||||||
$ pda config init --> FAIL
|
$ pda config init --> FAIL
|
||||||
FAIL config file already exists
|
FAIL config file already exists
|
||||||
hint use 'pda config edit' or 'pda config init --new'
|
hint use 'pda config edit' or 'pda config init --new'
|
||||||
|
|
||||||
# Init --new overwrites
|
# Init --new overwrites
|
||||||
$ pda config init --new
|
$ pda config init --new
|
||||||
|
|
|
||||||
2
testdata/cp-cross-store.ct
vendored
2
testdata/cp-cross-store.ct
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
# Cross-store copy
|
# Cross-store copy
|
||||||
$ pda set key@src value
|
$ pda set key@src value
|
||||||
$ pda cp key@src key@dst
|
$ pda cp key@src key@dst
|
||||||
ok copied key@src to key@dst
|
ok copied key@src to key@dst
|
||||||
$ pda get key@src
|
$ pda get key@src
|
||||||
value
|
value
|
||||||
$ pda get key@dst
|
$ pda get key@dst
|
||||||
|
|
|
||||||
2
testdata/cp-encrypt.ct
vendored
2
testdata/cp-encrypt.ct
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
# Copy an encrypted key; both keys should decrypt.
|
# Copy an encrypted key; both keys should decrypt.
|
||||||
$ pda set --encrypt secret-key@cpe hidden-value
|
$ pda set --encrypt secret-key@cpe hidden-value
|
||||||
$ pda cp secret-key@cpe copied-key@cpe
|
$ 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
|
$ pda get secret-key@cpe
|
||||||
hidden-value
|
hidden-value
|
||||||
$ pda get copied-key@cpe
|
$ pda get copied-key@cpe
|
||||||
|
|
|
||||||
2
testdata/cp-missing-err.ct
vendored
2
testdata/cp-missing-err.ct
vendored
|
|
@ -1,3 +1,3 @@
|
||||||
# Copy non-existent key
|
# Copy non-existent key
|
||||||
$ pda cp nonexistent dest --> FAIL
|
$ pda cp nonexistent dest --> FAIL
|
||||||
FAIL cannot move 'nonexistent': no such key
|
FAIL cannot move 'nonexistent': no such key
|
||||||
|
|
|
||||||
2
testdata/cp-safe.ct
vendored
2
testdata/cp-safe.ct
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
$ pda set src@csf hello
|
$ pda set src@csf hello
|
||||||
$ pda set dst@csf existing
|
$ pda set dst@csf existing
|
||||||
$ pda cp src@csf dst@csf --safe
|
$ pda cp src@csf dst@csf --safe
|
||||||
info skipped 'dst@csf': already exists
|
info skipped 'dst@csf': already exists
|
||||||
$ pda get dst@csf
|
$ pda get dst@csf
|
||||||
existing
|
existing
|
||||||
|
|
|
||||||
2
testdata/cp.ct
vendored
2
testdata/cp.ct
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
# Basic copy
|
# Basic copy
|
||||||
$ pda set source@cpok value
|
$ pda set source@cpok value
|
||||||
$ pda cp source@cpok dest@cpok
|
$ pda cp source@cpok dest@cpok
|
||||||
ok copied source@cpok to dest@cpok
|
ok copied source@cpok to dest@cpok
|
||||||
$ pda get source@cpok
|
$ pda get source@cpok
|
||||||
value
|
value
|
||||||
$ pda get dest@cpok
|
$ pda get dest@cpok
|
||||||
|
|
|
||||||
2
testdata/export-key-filter.ct
vendored
2
testdata/export-key-filter.ct
vendored
|
|
@ -5,4 +5,4 @@ $ pda export ekf --key "a*"
|
||||||
{"key":"a1","value":"1","encoding":"text","store":"ekf"}
|
{"key":"a1","value":"1","encoding":"text","store":"ekf"}
|
||||||
{"key":"a2","value":"2","encoding":"text","store":"ekf"}
|
{"key":"a2","value":"2","encoding":"text","store":"ekf"}
|
||||||
$ pda export ekf --key "c*" --> FAIL
|
$ 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*'
|
||||||
|
|
|
||||||
2
testdata/get-invalid-store-err.ct
vendored
2
testdata/get-invalid-store-err.ct
vendored
|
|
@ -1,2 +1,2 @@
|
||||||
$ pda get key@foo/bar --> FAIL
|
$ 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
|
||||||
|
|
|
||||||
14
testdata/get-missing-all-flags-err.ct
vendored
14
testdata/get-missing-all-flags-err.ct
vendored
|
|
@ -5,10 +5,10 @@ $ pda get foobar --base64 --run --secret --> FAIL
|
||||||
$ pda get foobar --run --> FAIL
|
$ pda get foobar --run --> FAIL
|
||||||
$ pda get foobar --run --secret --> FAIL
|
$ pda get foobar --run --secret --> FAIL
|
||||||
$ pda get foobar --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 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 unknown flag: --secret
|
||||||
FAIL cannot get 'foobar': no such key
|
FAIL cannot get 'foobar': no such key
|
||||||
FAIL unknown flag: --secret
|
FAIL unknown flag: --secret
|
||||||
FAIL unknown flag: --secret
|
FAIL unknown flag: --secret
|
||||||
|
|
|
||||||
2
testdata/get-missing-err.ct
vendored
2
testdata/get-missing-err.ct
vendored
|
|
@ -1,2 +1,2 @@
|
||||||
$ pda get foobar --> FAIL
|
$ pda get foobar --> FAIL
|
||||||
FAIL cannot get 'foobar': no such key
|
FAIL cannot get 'foobar': no such key
|
||||||
|
|
|
||||||
4
testdata/import-drop.ct
vendored
4
testdata/import-drop.ct
vendored
|
|
@ -2,8 +2,8 @@ $ pda set existing@idr keep-me
|
||||||
$ pda set other@idr also-keep
|
$ pda set other@idr also-keep
|
||||||
$ fecho dumpfile {"key":"new","value":"hello","encoding":"text"}
|
$ fecho dumpfile {"key":"new","value":"hello","encoding":"text"}
|
||||||
$ pda import idr --drop --file dumpfile
|
$ pda import idr --drop --file dumpfile
|
||||||
ok restored 1 entries into @idr
|
ok restored 1 entries into @idr
|
||||||
$ pda get new@idr
|
$ pda get new@idr
|
||||||
hello
|
hello
|
||||||
$ pda get existing@idr --> FAIL
|
$ pda get existing@idr --> FAIL
|
||||||
FAIL cannot get 'existing@idr': no such key
|
FAIL cannot get 'existing@idr': no such key
|
||||||
|
|
|
||||||
8
testdata/import-key-filter.ct
vendored
8
testdata/import-key-filter.ct
vendored
|
|
@ -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"}
|
$ 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 rm a1@ikf a2@ikf b1@ikf
|
||||||
$ pda import ikf --key "a*" --file dumpfile
|
$ pda import ikf --key "a*" --file dumpfile
|
||||||
ok restored 2 entries into @ikf
|
ok restored 2 entries into @ikf
|
||||||
$ pda get a1@ikf
|
$ pda get a1@ikf
|
||||||
1
|
1
|
||||||
$ pda get a2@ikf
|
$ pda get a2@ikf
|
||||||
2
|
2
|
||||||
$ pda get b1@ikf --> FAIL
|
$ pda get b1@ikf --> FAIL
|
||||||
FAIL cannot get 'b1@ikf': no such key
|
FAIL cannot get 'b1@ikf': no such key
|
||||||
hint did you mean 'a1'?
|
hint did you mean 'a1'?
|
||||||
$ pda import ikf --key "c*" --file dumpfile --> FAIL
|
$ 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*'
|
||||||
|
|
|
||||||
2
testdata/import-merge.ct
vendored
2
testdata/import-merge.ct
vendored
|
|
@ -2,7 +2,7 @@
|
||||||
$ pda set existing@mrg old-value
|
$ pda set existing@mrg old-value
|
||||||
$ fecho dumpfile {"key":"existing","value":"updated","encoding":"text"} {"key":"new","value":"hello","encoding":"text"}
|
$ fecho dumpfile {"key":"existing","value":"updated","encoding":"text"} {"key":"new","value":"hello","encoding":"text"}
|
||||||
$ pda import mrg --file dumpfile
|
$ pda import mrg --file dumpfile
|
||||||
ok restored 2 entries into @mrg
|
ok restored 2 entries into @mrg
|
||||||
$ pda get existing@mrg
|
$ pda get existing@mrg
|
||||||
updated
|
updated
|
||||||
$ pda get new@mrg
|
$ pda get new@mrg
|
||||||
|
|
|
||||||
2
testdata/import-stdin.ct
vendored
2
testdata/import-stdin.ct
vendored
|
|
@ -2,7 +2,7 @@
|
||||||
$ pda set existing@stn keep-me
|
$ pda set existing@stn keep-me
|
||||||
$ fecho dumpfile {"key":"new","value":"hello","encoding":"text"}
|
$ fecho dumpfile {"key":"new","value":"hello","encoding":"text"}
|
||||||
$ pda import stn < dumpfile
|
$ pda import stn < dumpfile
|
||||||
ok restored 1 entries into @stn
|
ok restored 1 entries into @stn
|
||||||
$ pda get existing@stn
|
$ pda get existing@stn
|
||||||
keep-me
|
keep-me
|
||||||
$ pda get new@stn
|
$ pda get new@stn
|
||||||
|
|
|
||||||
2
testdata/invalid-command-err.ct
vendored
2
testdata/invalid-command-err.ct
vendored
|
|
@ -1,2 +1,2 @@
|
||||||
$ pda invalidcmd --> FAIL
|
$ pda invalidcmd --> FAIL
|
||||||
FAIL unknown command "invalidcmd" for "pda"
|
FAIL unknown command "invalidcmd" for "pda"
|
||||||
|
|
|
||||||
4
testdata/list-all-suppressed-err.ct
vendored
4
testdata/list-all-suppressed-err.ct
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
# Error when all columns are suppressed
|
# Error when all columns are suppressed
|
||||||
$ pda set a@las 1
|
$ pda set a@las 1
|
||||||
$ pda ls las --no-keys --no-values --no-ttl --> FAIL
|
$ pda ls las --no-keys --no-values --no-ttl --> FAIL
|
||||||
FAIL cannot ls '@las': no columns selected
|
FAIL cannot ls '@las': no columns selected
|
||||||
hint disable --no-keys, --no-values, or --no-ttl
|
hint disable --no-keys, --no-values, or --no-ttl
|
||||||
|
|
|
||||||
4
testdata/list-all.ct
vendored
4
testdata/list-all.ct
vendored
|
|
@ -23,7 +23,7 @@ Key Store Value TTL
|
||||||
lax laa 1 no expiry
|
lax laa 1 no expiry
|
||||||
# --store cannot be combined with positional arg
|
# --store cannot be combined with positional arg
|
||||||
$ pda ls --store "laa" laa --> FAIL
|
$ 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
|
# --store no matches
|
||||||
$ pda ls --store "nonexistent" --key "lax" --> FAIL
|
$ 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'
|
||||||
|
|
|
||||||
2
testdata/list-invalid-store-err.ct
vendored
2
testdata/list-invalid-store-err.ct
vendored
|
|
@ -1,2 +1,2 @@
|
||||||
$ pda ls foo/bar --> FAIL
|
$ 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
|
||||||
|
|
|
||||||
2
testdata/list-key-filter.ct
vendored
2
testdata/list-key-filter.ct
vendored
|
|
@ -9,4 +9,4 @@ $ pda ls lg --key "b*" --format tsv
|
||||||
Key Store Value TTL
|
Key Store Value TTL
|
||||||
b1 lg 3 no expiry
|
b1 lg 3 no expiry
|
||||||
$ pda ls lg --key "c*" --> FAIL
|
$ 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*'
|
||||||
|
|
|
||||||
2
testdata/list-key-value-filter.ct
vendored
2
testdata/list-key-value-filter.ct
vendored
|
|
@ -8,4 +8,4 @@ $ pda ls kv -k "*url*" -v "**example**" --format tsv
|
||||||
Key Store Value TTL
|
Key Store Value TTL
|
||||||
apiurl kv https://api.example.com no expiry
|
apiurl kv https://api.example.com no expiry
|
||||||
$ pda ls kv -k "db*" -v "**nomatch**" --> FAIL
|
$ 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**'
|
||||||
|
|
|
||||||
2
testdata/list-value-filter.ct
vendored
2
testdata/list-value-filter.ct
vendored
|
|
@ -12,4 +12,4 @@ $ pda ls vt --value "*" --format tsv
|
||||||
Key Store Value TTL
|
Key Store Value TTL
|
||||||
number vt 42 no expiry
|
number vt 42 no expiry
|
||||||
$ pda ls vt --value "**nomatch**" --> FAIL
|
$ 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**'
|
||||||
|
|
|
||||||
4
testdata/mv-cross-store.ct
vendored
4
testdata/mv-cross-store.ct
vendored
|
|
@ -1,8 +1,8 @@
|
||||||
# Cross-store move
|
# Cross-store move
|
||||||
$ pda set key@src value
|
$ pda set key@src value
|
||||||
$ pda mv key@src key@dst
|
$ pda mv key@src key@dst
|
||||||
ok renamed key@src to key@dst
|
ok renamed key@src to key@dst
|
||||||
$ pda get key@dst
|
$ pda get key@dst
|
||||||
value
|
value
|
||||||
$ pda get key@src --> FAIL
|
$ pda get key@src --> FAIL
|
||||||
FAIL cannot get 'key@src': no such key
|
FAIL cannot get 'key@src': no such key
|
||||||
|
|
|
||||||
4
testdata/mv-encrypt.ct
vendored
4
testdata/mv-encrypt.ct
vendored
|
|
@ -1,8 +1,8 @@
|
||||||
# Move an encrypted key; the new key should still decrypt.
|
# Move an encrypted key; the new key should still decrypt.
|
||||||
$ pda set --encrypt secret-key@mve hidden-value
|
$ pda set --encrypt secret-key@mve hidden-value
|
||||||
$ pda mv secret-key@mve moved-key@mve
|
$ 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
|
$ pda get moved-key@mve
|
||||||
hidden-value
|
hidden-value
|
||||||
$ pda get secret-key@mve --> FAIL
|
$ pda get secret-key@mve --> FAIL
|
||||||
FAIL cannot get 'secret-key@mve': no such key
|
FAIL cannot get 'secret-key@mve': no such key
|
||||||
|
|
|
||||||
2
testdata/mv-missing-err.ct
vendored
2
testdata/mv-missing-err.ct
vendored
|
|
@ -1,3 +1,3 @@
|
||||||
# Move non-existent key
|
# Move non-existent key
|
||||||
$ pda mv nonexistent dest --> FAIL
|
$ pda mv nonexistent dest --> FAIL
|
||||||
FAIL cannot move 'nonexistent': no such key
|
FAIL cannot move 'nonexistent': no such key
|
||||||
|
|
|
||||||
2
testdata/mv-safe.ct
vendored
2
testdata/mv-safe.ct
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
$ pda set src@msf hello
|
$ pda set src@msf hello
|
||||||
$ pda set dst@msf existing
|
$ pda set dst@msf existing
|
||||||
$ pda mv src@msf dst@msf --safe
|
$ pda mv src@msf dst@msf --safe
|
||||||
info skipped 'dst@msf': already exists
|
info skipped 'dst@msf': already exists
|
||||||
$ pda get src@msf
|
$ pda get src@msf
|
||||||
hello
|
hello
|
||||||
$ pda get dst@msf
|
$ pda get dst@msf
|
||||||
|
|
|
||||||
2
testdata/mv-store-copy.ct
vendored
2
testdata/mv-store-copy.ct
vendored
|
|
@ -1,6 +1,6 @@
|
||||||
$ pda set key@msc1 value
|
$ pda set key@msc1 value
|
||||||
$ pda move-store msc1 msc2 --copy
|
$ pda move-store msc1 msc2 --copy
|
||||||
ok copied @msc1 to @msc2
|
ok copied @msc1 to @msc2
|
||||||
$ pda get key@msc1
|
$ pda get key@msc1
|
||||||
value
|
value
|
||||||
$ pda get key@msc2
|
$ pda get key@msc2
|
||||||
|
|
|
||||||
2
testdata/mv-store-missing-err.ct
vendored
2
testdata/mv-store-missing-err.ct
vendored
|
|
@ -1,2 +1,2 @@
|
||||||
$ pda move-store nonexistent dest --> FAIL
|
$ pda move-store nonexistent dest --> FAIL
|
||||||
FAIL cannot rename store 'nonexistent': no such store
|
FAIL cannot rename store 'nonexistent': no such store
|
||||||
|
|
|
||||||
2
testdata/mv-store-safe.ct
vendored
2
testdata/mv-store-safe.ct
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
$ pda set a@mssf1 1
|
$ pda set a@mssf1 1
|
||||||
$ pda set b@mssf2 2
|
$ pda set b@mssf2 2
|
||||||
$ pda move-store mssf1 mssf2 --safe
|
$ pda move-store mssf1 mssf2 --safe
|
||||||
info skipped '@mssf2': already exists
|
info skipped '@mssf2': already exists
|
||||||
$ pda get a@mssf1
|
$ pda get a@mssf1
|
||||||
1
|
1
|
||||||
$ pda get b@mssf2
|
$ pda get b@mssf2
|
||||||
|
|
|
||||||
2
testdata/mv-store-same-err.ct
vendored
2
testdata/mv-store-same-err.ct
vendored
|
|
@ -1,3 +1,3 @@
|
||||||
$ pda set a@mss same
|
$ pda set a@mss same
|
||||||
$ pda move-store mss mss --> FAIL
|
$ 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
|
||||||
|
|
|
||||||
2
testdata/mv-store.ct
vendored
2
testdata/mv-store.ct
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
$ pda set key@mvs1 value
|
$ pda set key@mvs1 value
|
||||||
$ pda move-store mvs1 mvs2
|
$ pda move-store mvs1 mvs2
|
||||||
ok renamed @mvs1 to @mvs2
|
ok renamed @mvs1 to @mvs2
|
||||||
$ pda get key@mvs2
|
$ pda get key@mvs2
|
||||||
value
|
value
|
||||||
|
|
|
||||||
4
testdata/mv.ct
vendored
4
testdata/mv.ct
vendored
|
|
@ -1,8 +1,8 @@
|
||||||
# Basic move
|
# Basic move
|
||||||
$ pda set source@mvok value
|
$ pda set source@mvok value
|
||||||
$ pda mv source@mvok dest@mvok
|
$ pda mv source@mvok dest@mvok
|
||||||
ok renamed source@mvok to dest@mvok
|
ok renamed source@mvok to dest@mvok
|
||||||
$ pda get dest@mvok
|
$ pda get dest@mvok
|
||||||
value
|
value
|
||||||
$ pda get source@mvok --> FAIL
|
$ pda get source@mvok --> FAIL
|
||||||
FAIL cannot get 'source@mvok': no such key
|
FAIL cannot get 'source@mvok': no such key
|
||||||
|
|
|
||||||
4
testdata/remove-dedupe.ct
vendored
4
testdata/remove-dedupe.ct
vendored
|
|
@ -7,6 +7,6 @@ bar rdd 2 no expiry
|
||||||
foo rdd 1 no expiry
|
foo rdd 1 no expiry
|
||||||
$ pda rm foo@rdd --key "*@rdd" -y
|
$ pda rm foo@rdd --key "*@rdd" -y
|
||||||
$ pda get bar@rdd --> FAIL
|
$ 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
|
$ pda get foo@rdd --> FAIL
|
||||||
FAIL cannot get 'foo@rdd': no such key
|
FAIL cannot get 'foo@rdd': no such key
|
||||||
|
|
|
||||||
6
testdata/remove-key-glob.ct
vendored
6
testdata/remove-key-glob.ct
vendored
|
|
@ -3,9 +3,9 @@ $ pda set a2@rkg 2
|
||||||
$ pda set b1@rkg 3
|
$ pda set b1@rkg 3
|
||||||
$ pda rm --key "a*@rkg" -y
|
$ pda rm --key "a*@rkg" -y
|
||||||
$ pda get a1@rkg --> FAIL
|
$ pda get a1@rkg --> FAIL
|
||||||
FAIL cannot get 'a1@rkg': no such key
|
FAIL cannot get 'a1@rkg': no such key
|
||||||
hint did you mean 'b1'?
|
hint did you mean 'b1'?
|
||||||
$ pda get a2@rkg --> FAIL
|
$ 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
|
$ pda get b1@rkg
|
||||||
3
|
3
|
||||||
|
|
|
||||||
6
testdata/remove-key-mixed.ct
vendored
6
testdata/remove-key-mixed.ct
vendored
|
|
@ -3,8 +3,8 @@ $ pda set bar1@rkm 2
|
||||||
$ pda set bar2@rkm 3
|
$ pda set bar2@rkm 3
|
||||||
$ pda rm foo@rkm --key "bar*@rkm" -y
|
$ pda rm foo@rkm --key "bar*@rkm" -y
|
||||||
$ pda get foo@rkm --> FAIL
|
$ 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
|
$ 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
|
$ pda get bar2@rkm --> FAIL
|
||||||
FAIL cannot get 'bar2@rkm': no such key
|
FAIL cannot get 'bar2@rkm': no such key
|
||||||
|
|
|
||||||
4
testdata/remove-multiple.ct
vendored
4
testdata/remove-multiple.ct
vendored
|
|
@ -2,6 +2,6 @@ $ pda set a@rmm 1
|
||||||
$ pda set b@rmm 2
|
$ pda set b@rmm 2
|
||||||
$ pda rm a@rmm b@rmm
|
$ pda rm a@rmm b@rmm
|
||||||
$ pda get a@rmm --> FAIL
|
$ 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
|
$ pda get b@rmm --> FAIL
|
||||||
FAIL cannot get 'b@rmm': no such key
|
FAIL cannot get 'b@rmm': no such key
|
||||||
|
|
|
||||||
2
testdata/remove-store-invalid-err.ct
vendored
2
testdata/remove-store-invalid-err.ct
vendored
|
|
@ -1,2 +1,2 @@
|
||||||
$ pda rms foo/bar --> FAIL
|
$ 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
|
||||||
|
|
|
||||||
4
testdata/remove-yes.ct
vendored
4
testdata/remove-yes.ct
vendored
|
|
@ -2,7 +2,7 @@ $ pda set a@ry "1"
|
||||||
$ pda set b@ry "2"
|
$ pda set b@ry "2"
|
||||||
$ pda rm a@ry -i -y
|
$ pda rm a@ry -i -y
|
||||||
$ pda get a@ry --> FAIL
|
$ pda get a@ry --> FAIL
|
||||||
FAIL cannot get 'a@ry': no such key
|
FAIL cannot get 'a@ry': no such key
|
||||||
hint did you mean 'b'?
|
hint did you mean 'b'?
|
||||||
$ pda get b@ry
|
$ pda get b@ry
|
||||||
"2"
|
"2"
|
||||||
|
|
|
||||||
2
testdata/set-file-conflict-err.ct
vendored
2
testdata/set-file-conflict-err.ct
vendored
|
|
@ -1,3 +1,3 @@
|
||||||
$ fecho myfile contents
|
$ fecho myfile contents
|
||||||
$ pda set key@sfc value --file myfile --> FAIL
|
$ 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
|
||||||
|
|
|
||||||
2
testdata/set-invalid-ttl-err.ct
vendored
2
testdata/set-invalid-ttl-err.ct
vendored
|
|
@ -1,2 +1,2 @@
|
||||||
$ pda set a b --ttl 3343r --> FAIL
|
$ 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"
|
||||||
|
|
|
||||||
2
testdata/set-safe.ct
vendored
2
testdata/set-safe.ct
vendored
|
|
@ -2,7 +2,7 @@ $ pda set key@ss "original" --safe
|
||||||
$ pda get key@ss
|
$ pda get key@ss
|
||||||
"original"
|
"original"
|
||||||
$ pda set key@ss "overwritten" --safe
|
$ pda set key@ss "overwritten" --safe
|
||||||
info skipped 'key@ss': already exists
|
info skipped 'key@ss': already exists
|
||||||
$ pda get key@ss
|
$ pda get key@ss
|
||||||
"original"
|
"original"
|
||||||
$ pda set newkey@ss "fresh" --safe
|
$ pda set newkey@ss "fresh" --safe
|
||||||
|
|
|
||||||
2
testdata/template-enum-err.ct
vendored
2
testdata/template-enum-err.ct
vendored
|
|
@ -2,4 +2,4 @@
|
||||||
$ fecho tpl {{ enum .LEVEL "info" "warn" }}
|
$ fecho tpl {{ enum .LEVEL "info" "warn" }}
|
||||||
$ pda set level@tple < tpl
|
$ pda set level@tple < tpl
|
||||||
$ pda get level@tple LEVEL=debug --> FAIL
|
$ pda get level@tple LEVEL=debug --> FAIL
|
||||||
FAIL cannot get 'level@tple': template: cmd:1:3: executing "cmd" at <enum .LEVEL "info" "warn">: error calling enum: invalid value 'debug', allowed: [info warn]
|
FAIL cannot get 'level@tple': template: cmd:1:3: executing "cmd" at <enum .LEVEL "info" "warn">: error calling enum: invalid value 'debug', allowed: [info warn]
|
||||||
|
|
|
||||||
2
testdata/template-require-err.ct
vendored
2
testdata/template-require-err.ct
vendored
|
|
@ -2,4 +2,4 @@
|
||||||
$ fecho tpl {{ require .FILE }}
|
$ fecho tpl {{ require .FILE }}
|
||||||
$ pda set tmpl@tplr < tpl
|
$ pda set tmpl@tplr < tpl
|
||||||
$ pda get tmpl@tplr --> FAIL
|
$ pda get tmpl@tplr --> FAIL
|
||||||
FAIL cannot get 'tmpl@tplr': template: cmd:1:3: executing "cmd" at <require .FILE>: error calling require: required value is missing or empty
|
FAIL cannot get 'tmpl@tplr': template: cmd:1:3: executing "cmd" at <require .FILE>: error calling require: required value is missing or empty
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue