feat: command rename finalising
This commit is contained in:
parent
8ea865b2ce
commit
a4d2e919dc
15 changed files with 22 additions and 33 deletions
4
testdata/dump__key__ok.ct
vendored
4
testdata/dump__key__ok.ct
vendored
|
|
@ -1,8 +1,8 @@
|
|||
$ pda set a1 1
|
||||
$ pda set a2 2
|
||||
$ pda set b1 3
|
||||
$ pda dump --key "a*"
|
||||
$ pda export --key "a*"
|
||||
{"key":"a1","value":"1","encoding":"text"}
|
||||
{"key":"a2","value":"2","encoding":"text"}
|
||||
$ pda dump --key "c*" --> FAIL
|
||||
$ pda export --key "c*" --> FAIL
|
||||
FAIL cannot ls '@default': no matches for key pattern 'c*'
|
||||
|
|
|
|||
4
testdata/dump__value__ok.ct
vendored
4
testdata/dump__value__ok.ct
vendored
|
|
@ -2,7 +2,7 @@ $ pda set url https://example.com
|
|||
$ fecho tmpval hello world
|
||||
$ pda set greeting < tmpval
|
||||
$ pda set number 42
|
||||
$ pda dump --value "**https**"
|
||||
$ pda export --value "**https**"
|
||||
{"key":"url","value":"https://example.com","encoding":"text"}
|
||||
$ pda dump --value "**world**"
|
||||
$ pda export --value "**world**"
|
||||
{"key":"greeting","value":"hello world\n","encoding":"text"}
|
||||
|
|
|
|||
10
testdata/help__dump__ok.ct
vendored
10
testdata/help__dump__ok.ct
vendored
|
|
@ -1,13 +1,10 @@
|
|||
$ pda help dump
|
||||
$ pda dump --help
|
||||
$ pda help export
|
||||
$ pda export --help
|
||||
Export store as NDJSON (alias for list --format ndjson)
|
||||
|
||||
Usage:
|
||||
pda export [STORE] [flags]
|
||||
|
||||
Aliases:
|
||||
export, dump
|
||||
|
||||
Flags:
|
||||
-h, --help help for export
|
||||
-k, --key strings Filter keys with glob pattern (repeatable)
|
||||
|
|
@ -17,9 +14,6 @@ Export store as NDJSON (alias for list --format ndjson)
|
|||
Usage:
|
||||
pda export [STORE] [flags]
|
||||
|
||||
Aliases:
|
||||
export, dump
|
||||
|
||||
Flags:
|
||||
-h, --help help for export
|
||||
-k, --key strings Filter keys with glob pattern (repeatable)
|
||||
|
|
|
|||
4
testdata/help__list-dbs__ok.ct
vendored
4
testdata/help__list-dbs__ok.ct
vendored
|
|
@ -6,7 +6,7 @@ Usage:
|
|||
pda list-stores [flags]
|
||||
|
||||
Aliases:
|
||||
list-stores, ls-stores, lss
|
||||
list-stores, lss
|
||||
|
||||
Flags:
|
||||
-h, --help help for list-stores
|
||||
|
|
@ -16,7 +16,7 @@ Usage:
|
|||
pda list-stores [flags]
|
||||
|
||||
Aliases:
|
||||
list-stores, ls-stores, lss
|
||||
list-stores, lss
|
||||
|
||||
Flags:
|
||||
-h, --help help for list-stores
|
||||
|
|
|
|||
4
testdata/help__remove-store__ok.ct
vendored
4
testdata/help__remove-store__ok.ct
vendored
|
|
@ -6,7 +6,7 @@ Usage:
|
|||
pda remove-store STORE [flags]
|
||||
|
||||
Aliases:
|
||||
remove-store, rm-store, rms
|
||||
remove-store, rms
|
||||
|
||||
Flags:
|
||||
-h, --help help for remove-store
|
||||
|
|
@ -17,7 +17,7 @@ Usage:
|
|||
pda remove-store STORE [flags]
|
||||
|
||||
Aliases:
|
||||
remove-store, rm-store, rms
|
||||
remove-store, rms
|
||||
|
||||
Flags:
|
||||
-h, --help help for remove-store
|
||||
|
|
|
|||
10
testdata/help__restore__ok.ct
vendored
10
testdata/help__restore__ok.ct
vendored
|
|
@ -1,13 +1,10 @@
|
|||
$ pda help restore
|
||||
$ pda restore --help
|
||||
$ pda help import
|
||||
$ pda import --help
|
||||
Restore key/value pairs from an NDJSON dump
|
||||
|
||||
Usage:
|
||||
pda import [STORE] [flags]
|
||||
|
||||
Aliases:
|
||||
import, restore
|
||||
|
||||
Flags:
|
||||
--drop Drop existing entries before restoring (full replace)
|
||||
-f, --file string Path to an NDJSON dump (defaults to stdin)
|
||||
|
|
@ -19,9 +16,6 @@ Restore key/value pairs from an NDJSON dump
|
|||
Usage:
|
||||
pda import [STORE] [flags]
|
||||
|
||||
Aliases:
|
||||
import, restore
|
||||
|
||||
Flags:
|
||||
--drop Drop existing entries before restoring (full replace)
|
||||
-f, --file string Path to an NDJSON dump (defaults to stdin)
|
||||
|
|
|
|||
2
testdata/restore__drop__ok.ct
vendored
2
testdata/restore__drop__ok.ct
vendored
|
|
@ -1,7 +1,7 @@
|
|||
$ pda set existing keep-me
|
||||
$ pda set other also-keep
|
||||
$ fecho dumpfile {"key":"new","value":"hello","encoding":"text"}
|
||||
$ pda restore --drop --file dumpfile
|
||||
$ pda import --drop --file dumpfile
|
||||
ok restored 1 entries into @default
|
||||
$ pda get new
|
||||
hello
|
||||
|
|
|
|||
4
testdata/restore__key__ok.ct
vendored
4
testdata/restore__key__ok.ct
vendored
|
|
@ -3,7 +3,7 @@ $ pda set a2 2
|
|||
$ 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 --key "a*" --file dumpfile
|
||||
$ pda import --key "a*" --file dumpfile
|
||||
ok restored 2 entries into @default
|
||||
$ pda get a1
|
||||
1
|
||||
|
|
@ -12,5 +12,5 @@ $ pda get a2
|
|||
$ pda get b1 --> FAIL
|
||||
FAIL cannot get 'b1': no such key
|
||||
hint did you mean 'a1'?
|
||||
$ pda restore --key "c*" --file dumpfile --> FAIL
|
||||
$ pda import --key "c*" --file dumpfile --> FAIL
|
||||
FAIL cannot restore '@default': no matches for key pattern 'c*'
|
||||
|
|
|
|||
2
testdata/restore__merge__ok.ct
vendored
2
testdata/restore__merge__ok.ct
vendored
|
|
@ -1,7 +1,7 @@
|
|||
# Merge import updates existing entries and adds new ones
|
||||
$ pda set existing@mrg old-value
|
||||
$ fecho dumpfile {"key":"existing","value":"updated","encoding":"text"} {"key":"new","value":"hello","encoding":"text"}
|
||||
$ pda restore mrg --file dumpfile
|
||||
$ pda import mrg --file dumpfile
|
||||
ok restored 2 entries into @mrg
|
||||
$ pda get existing@mrg
|
||||
updated
|
||||
|
|
|
|||
2
testdata/restore__stdin__ok.ct
vendored
2
testdata/restore__stdin__ok.ct
vendored
|
|
@ -1,7 +1,7 @@
|
|||
# Import from stdin preserves existing entries
|
||||
$ pda set existing@stn keep-me
|
||||
$ fecho dumpfile {"key":"new","value":"hello","encoding":"text"}
|
||||
$ pda restore stn < dumpfile
|
||||
$ pda import stn < dumpfile
|
||||
ok restored 1 entries into @stn
|
||||
$ pda get existing@stn
|
||||
keep-me
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue