Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty environment variable and empty yaml key behave differently #296

Open
rngadam opened this issue Aug 22, 2024 · 0 comments
Open

Empty environment variable and empty yaml key behave differently #296

rngadam opened this issue Aug 22, 2024 · 0 comments

Comments

@rngadam
Copy link

rngadam commented Aug 22, 2024

configargparse v1.7

usage

given this add_argument:

        parser.add_argument(
            "--accept-taa",
            type=str,
            nargs=2,
            metavar=("<acceptance-mechanism>", "<taa-version>"),
            env_var="ACAPY_ACCEPT_TAA",
            help=(
                "Specify the acceptance mechanism and taa version for which to accept"
                " the transaction author agreement. If not provided, the TAA must"
                " be accepted through the TTY or the admin API."
            ),
        )

yaml

given this yaml file:

accept-taa: 

value is not set and is ignored

yaml

given this environment variable (loaded with docker --env-file):

ACAPY_ACCEPT_TAA=

exception:

error: argument --accept-taa: expected 2 arguments

expected

empty environment variable same behavior as no value yaml; if value-less and expect a value, just treat it as not specified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant