Store the given key/value.
(ctx: click.Context, key: Any, value: Any)
| 94 | @click.argument('key', required=True) |
| 95 | @click.argument('value', required=True) |
| 96 | def set(ctx: click.Context, key: Any, value: Any) -> None: |
| 97 | """Store the given key/value.""" |
| 98 | file = ctx.obj['FILE'] |
| 99 | quote = ctx.obj['QUOTE'] |
| 100 | export = ctx.obj['EXPORT'] |
| 101 | success, key, value = set_key(file, key, value, quote, export) |
| 102 | if success: |
| 103 | click.echo(f'{key}={value}') |
| 104 | else: |
| 105 | exit(1) |
| 106 | |
| 107 | |
| 108 | @cli.command() |