Config: Allow existing values to get included in generated file
Allows for generation from an existing config file. Primarily used for migration purposes. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
7f03003437
commit
81ae461eb8
3 changed files with 20 additions and 8 deletions
|
|
@ -4,7 +4,7 @@ import argparse
|
|||
from pydantic import BaseModel
|
||||
|
||||
from common.config_models import TabbyConfigModel
|
||||
from common.utils import is_list_type, unwrap_optional
|
||||
from common.utils import is_list_type, unwrap_optional_type
|
||||
|
||||
|
||||
def add_field_to_group(group, field_name, field_type, field) -> None:
|
||||
|
|
@ -32,7 +32,7 @@ def init_argparser() -> argparse.ArgumentParser:
|
|||
|
||||
# Loop through each top-level field in the config
|
||||
for field_name, field_info in TabbyConfigModel.model_fields.items():
|
||||
field_type = unwrap_optional(field_info.annotation)
|
||||
field_type = unwrap_optional_type(field_info.annotation)
|
||||
group = parser.add_argument_group(
|
||||
field_name, description=f"Arguments for {field_name}"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue