feat(config): some additional config options, and config migration from deprecated keys

This commit is contained in:
Lewis Wynne 2026-02-12 19:31:24 +00:00
parent 629358a81b
commit 4e78cefd56
16 changed files with 363 additions and 51 deletions

View file

@ -1,16 +1,19 @@
# Set a bool value and verify with get
$ pda config set git.auto_commit true
$ pda config get git.auto_commit
ok git.auto_commit set to 'true'
true
# Set a string value
$ pda config set store.default_store_name mystore
$ pda config get store.default_store_name
ok store.default_store_name set to 'mystore'
mystore
# Set back to original
$ pda config set git.auto_commit false
$ pda config get git.auto_commit
ok git.auto_commit set to 'false'
false
# Bad type
@ -24,9 +27,32 @@ FAIL cannot set 'list.default_list_format': must be one of 'table', 'tsv', 'csv'
# Valid list format
$ pda config set list.default_list_format json
$ pda config get list.default_list_format
ok list.default_list_format set to 'json'
json
# Invalid list columns
$ pda config set list.default_columns foo --> FAIL
FAIL cannot set 'list.default_columns': must be a comma-separated list of 'key', 'store', 'value', 'ttl' (got 'foo')
# Duplicate columns
$ pda config set list.default_columns key,key --> FAIL
FAIL cannot set 'list.default_columns': duplicate column 'key'
# Valid list columns
$ pda config set list.default_columns key,value
$ pda config get list.default_columns
ok list.default_columns set to 'key,value'
key,value
# Unknown key
$ pda config set git.auto_comit true --> FAIL
FAIL unknown config key 'git.auto_comit'
hint did you mean 'git.auto_commit'?
# Reset changed values so subsequent tests see defaults
$ pda config set store.default_store_name default
$ pda config set list.default_list_format table
$ pda config set list.default_columns key,store,value,ttl
ok store.default_store_name set to 'default'
ok list.default_list_format set to 'table'
ok list.default_columns set to 'key,store,value,ttl'