feat(config): add config set subcommand with type validation
This commit is contained in:
parent
c9b448d508
commit
4afc0fd8ce
2 changed files with 72 additions and 0 deletions
23
testdata/config-set.ct
vendored
Normal file
23
testdata/config-set.ct
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# Set a bool value and verify with get
|
||||
$ pda config set git.auto_commit true
|
||||
$ pda config get git.auto_commit
|
||||
true
|
||||
|
||||
# Set a string value
|
||||
$ pda config set store.default_store_name mystore
|
||||
$ pda config get store.default_store_name
|
||||
mystore
|
||||
|
||||
# Set back to original
|
||||
$ pda config set git.auto_commit false
|
||||
$ pda config get git.auto_commit
|
||||
false
|
||||
|
||||
# Bad type
|
||||
$ pda config set git.auto_commit yes --> FAIL
|
||||
FAIL cannot set 'git.auto_commit': expected bool (true/false), got 'yes'
|
||||
|
||||
# Unknown key
|
||||
$ pda config set git.auto_comit true --> FAIL
|
||||
FAIL unknown config key 'git.auto_comit'
|
||||
hint did you mean 'git.auto_commit'?
|
||||
Loading…
Add table
Add a link
Reference in a new issue