is there way to make both --opt-with-dash
and environment variable work at the same time?
#469
Labels
--opt-with-dash
and environment variable work at the same time?
#469
test using #468
output:
So the Settings, use
alias_generator=AliasGenerator(lambda s: s.replace('_', '-'))
which cause the env_prefix has no effect, the sub_model become sub-model so it won't find any sub_model in env.Settings1, doe not have the alias generator, so the env options works normally.
Settings2, attempt to use
alias_generator=AliasGenerator(validation_alias=lambda field_name: AliasChoices(field_name, field_name.replace("_", "-")))
to allow both--sub-model
and env_* options to work. But it raise error withoutextra="ignore"
:with
extra="ignore"
, both'--sub_model.v1=cli'
and'--sub-model.v1=cli'
has no effect.The text was updated successfully, but these errors were encountered: