Retrieve the value for the given key.
(ctx: click.Context, key: Any)
| 135 | @click.pass_context |
| 136 | @click.argument("key", required=True) |
| 137 | def get(ctx: click.Context, key: Any) -> None: |
| 138 | """Retrieve the value for the given key.""" |
| 139 | file = ctx.obj["FILE"] |
| 140 | |
| 141 | with stream_file(file) as stream: |
| 142 | values = dotenv_values(stream=stream) |
| 143 | |
| 144 | stored_value = values.get(key) |
| 145 | if stored_value: |
| 146 | click.echo(stored_value) |
| 147 | else: |
| 148 | sys.exit(1) |
| 149 | |
| 150 | |
| 151 | @cli.command() |
nothing calls this directly
no test coverage detected