feat: huge overhaul of messaging into FAIL, WARN, hint, ok, prompt, and progress types
This commit is contained in:
parent
6ccd801c89
commit
b52a5bfdb7
30 changed files with 192 additions and 96 deletions
2
testdata/dump__glob__ok.ct
vendored
2
testdata/dump__glob__ok.ct
vendored
|
|
@ -5,4 +5,4 @@ $ pda dump --glob a*
|
|||
{"key":"a1","value":"1","encoding":"text"}
|
||||
{"key":"a2","value":"2","encoding":"text"}
|
||||
$ pda dump --glob c* --> FAIL
|
||||
Error: cannot ls '@default': No matches for pattern 'c*'
|
||||
FAIL cannot ls '@default': no matches for pattern 'c*'
|
||||
|
|
|
|||
2
testdata/get__err__with__invalid_db.ct
vendored
2
testdata/get__err__with__invalid_db.ct
vendored
|
|
@ -1,2 +1,2 @@
|
|||
$ pda get key@foo/bar --> FAIL
|
||||
Error: 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
|
||||
|
|
|
|||
2
testdata/get__missing__err.ct
vendored
2
testdata/get__missing__err.ct
vendored
|
|
@ -1,2 +1,2 @@
|
|||
$ pda get foobar --> FAIL
|
||||
Error: cannot get 'foobar': No such key
|
||||
FAIL cannot get 'foobar': no such key
|
||||
|
|
|
|||
14
testdata/get__missing__err__with__any.ct
vendored
14
testdata/get__missing__err__with__any.ct
vendored
|
|
@ -5,10 +5,10 @@ $ pda get foobar --include-binary --run --secret --> FAIL
|
|||
$ pda get foobar --run --> FAIL
|
||||
$ pda get foobar --run --secret --> FAIL
|
||||
$ pda get foobar --secret --> FAIL
|
||||
Error: cannot get 'foobar': No such key
|
||||
Error: cannot get 'foobar': No such key
|
||||
Error: cannot get 'foobar': No such key
|
||||
Error: unknown flag: --secret
|
||||
Error: cannot get 'foobar': No such key
|
||||
Error: unknown flag: --secret
|
||||
Error: 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
|
||||
|
|
|
|||
3
testdata/invalid__err.ct
vendored
3
testdata/invalid__err.ct
vendored
|
|
@ -1,3 +1,2 @@
|
|||
$ pda invalidcmd --> FAIL
|
||||
Error: unknown command "invalidcmd" for "pda"
|
||||
Run 'pda --help' for usage.
|
||||
FAIL unknown command "invalidcmd" for "pda"
|
||||
|
|
|
|||
2
testdata/list__err__with__invalid_db.ct
vendored
2
testdata/list__err__with__invalid_db.ct
vendored
|
|
@ -1,2 +1,2 @@
|
|||
$ pda ls foo/bar --> FAIL
|
||||
Error: 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__glob__ok.ct
vendored
2
testdata/list__glob__ok.ct
vendored
|
|
@ -7,4 +7,4 @@ a2 2
|
|||
$ pda ls lg --glob b* --format tsv
|
||||
b1 3
|
||||
$ pda ls lg --glob c* --> FAIL
|
||||
Error: cannot ls '@lg': No matches for pattern 'c*'
|
||||
FAIL cannot ls '@lg': no matches for pattern 'c*'
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
$ pda rms foo/bar --> FAIL
|
||||
Error: 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__dedupe__ok.ct
vendored
4
testdata/remove__dedupe__ok.ct
vendored
|
|
@ -10,6 +10,6 @@ $ pda ls
|
|||
foo 1
|
||||
$ pda rm foo --glob "*"
|
||||
$ pda get bar --> FAIL
|
||||
Error: cannot get 'bar': No such key
|
||||
FAIL cannot get 'bar': no such key
|
||||
$ pda get foo --> FAIL
|
||||
Error: cannot get 'foo': No such key
|
||||
FAIL cannot get 'foo': no such key
|
||||
|
|
|
|||
6
testdata/remove__glob__mixed__ok.ct
vendored
6
testdata/remove__glob__mixed__ok.ct
vendored
|
|
@ -3,8 +3,8 @@ $ pda set bar1 2
|
|||
$ pda set bar2 3
|
||||
$ pda rm foo --glob bar*
|
||||
$ pda get foo --> FAIL
|
||||
Error: cannot get 'foo': No such key
|
||||
FAIL cannot get 'foo': no such key
|
||||
$ pda get bar1 --> FAIL
|
||||
Error: cannot get 'bar1': No such key
|
||||
FAIL cannot get 'bar1': no such key
|
||||
$ pda get bar2 --> FAIL
|
||||
Error: cannot get 'bar2': No such key
|
||||
FAIL cannot get 'bar2': no such key
|
||||
|
|
|
|||
5
testdata/remove__glob__ok.ct
vendored
5
testdata/remove__glob__ok.ct
vendored
|
|
@ -3,8 +3,9 @@ $ pda set a2 2
|
|||
$ pda set b1 3
|
||||
$ pda rm --glob a*
|
||||
$ pda get a1 --> FAIL
|
||||
Error: cannot get 'a1': No such key. Did you mean 'b1'?
|
||||
FAIL cannot get 'a1': no such key
|
||||
hint did you mean 'b1'?
|
||||
$ pda get a2 --> FAIL
|
||||
Error: cannot get 'a2': No such key
|
||||
FAIL cannot get 'a2': no such key
|
||||
$ pda get b1
|
||||
3
|
||||
|
|
|
|||
5
testdata/remove__multiple__ok.ct
vendored
5
testdata/remove__multiple__ok.ct
vendored
|
|
@ -2,6 +2,7 @@ $ pda set a 1
|
|||
$ pda set b 2
|
||||
$ pda rm a b
|
||||
$ pda get a --> FAIL
|
||||
Error: cannot get 'a': No such key
|
||||
FAIL cannot get 'a': no such key
|
||||
$ pda get b --> FAIL
|
||||
Error: cannot get 'b': No such key. Did you mean 'b1'?
|
||||
FAIL cannot get 'b': no such key
|
||||
hint did you mean 'b1'?
|
||||
|
|
|
|||
4
testdata/restore__drop__ok.ct
vendored
4
testdata/restore__drop__ok.ct
vendored
|
|
@ -2,8 +2,8 @@ $ pda set existing keep-me
|
|||
$ pda set other also-keep
|
||||
$ fecho dumpfile {"key":"new","value":"hello","encoding":"text"}
|
||||
$ pda restore --drop --file dumpfile
|
||||
Restored 1 entries into @default
|
||||
ok restored 1 entries into @default
|
||||
$ pda get new
|
||||
hello
|
||||
$ pda get existing --> FAIL
|
||||
Error: cannot get 'existing': No such key
|
||||
FAIL cannot get 'existing': no such key
|
||||
|
|
|
|||
7
testdata/restore__glob__ok.ct
vendored
7
testdata/restore__glob__ok.ct
vendored
|
|
@ -4,12 +4,13 @@ $ pda set b1 3
|
|||
$ fecho dumpfile {"key":"a1","value":"1","encoding":"text"} {"key":"a2","value":"2","encoding":"text"} {"key":"b1","value":"3","encoding":"text"}
|
||||
$ pda rm a1 a2 b1
|
||||
$ pda restore --glob a* --file dumpfile
|
||||
Restored 2 entries into @default
|
||||
ok restored 2 entries into @default
|
||||
$ pda get a1
|
||||
1
|
||||
$ pda get a2
|
||||
2
|
||||
$ pda get b1 --> FAIL
|
||||
Error: cannot get 'b1': No such key. Did you mean 'a1'?
|
||||
FAIL cannot get 'b1': no such key
|
||||
hint did you mean 'a1'?
|
||||
$ pda restore --glob c* --file dumpfile --> FAIL
|
||||
Error: cannot restore '@default': No matches for pattern 'c*'
|
||||
FAIL cannot restore '@default': no matches for pattern 'c*'
|
||||
|
|
|
|||
2
testdata/set__err__with__invalid-ttl.ct
vendored
2
testdata/set__err__with__invalid-ttl.ct
vendored
|
|
@ -1,2 +1,2 @@
|
|||
$ pda set a b --ttl 3343r --> FAIL
|
||||
Error: 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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue