Store the given key/value. This doesn't follow symlinks, to avoid accidentally modifying a file at a potentially untrusted path.
(ctx: click.Context, key: Any, value: Any)
| 114 | @click.argument("key", required=True) |
| 115 | @click.argument("value", required=True) |
| 116 | def set_value(ctx: click.Context, key: Any, value: Any) -> None: |
| 117 | """ |
| 118 | Store the given key/value. |
| 119 | |
| 120 | This doesn't follow symlinks, to avoid accidentally modifying a file at a |
| 121 | potentially untrusted path. |
| 122 | """ |
| 123 | |
| 124 | file = ctx.obj["FILE"] |
| 125 | quote = ctx.obj["QUOTE"] |
| 126 | export = ctx.obj["EXPORT"] |
| 127 | success, key, value = set_key(file, key, value, quote, export) |
| 128 | if success: |
| 129 | click.echo(f"{key}={value}") |
| 130 | else: |
| 131 | sys.exit(1) |
| 132 | |
| 133 | |
| 134 | @cli.command() |
nothing calls this directly
no test coverage detected
searching dependent graphs…