Skip to content
Snippets Groups Projects
Commit 77542146 authored by Kristian Klausen's avatar Kristian Klausen :tada:
Browse files

Rewrite get_key.py to use click instead of typer

Typer doesn't work with Click 8[1].

[1] https://github.com/tiangolo/typer/issues/280
parent 652185f3
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@ This repository contains the complete collection of ansible playbooks and roles
Install these packages:
- terraform
- python-typer
- python-click
- python-jmespath
- moreutils (for playbooks/tasks/reencrypt-vault-key.yml)
......
......@@ -7,11 +7,9 @@ from contextlib import contextmanager
from enum import Enum
from pathlib import Path
from typing import List
import typer
import click
import yaml
app = typer.Typer()
@contextmanager
def chdir(path):
......@@ -56,14 +54,11 @@ class OutputFormat(str, Enum):
def __str__(self):
return self.value
def main(
vault: Path = typer.Argument(...),
keys: List[str] = typer.Argument(...),
format: OutputFormat = typer.Option(
OutputFormat.BARE, show_default=True, help="Output format"
),
):
@click.command()
@click.argument('vault', type=click.Path(exists=True))
@click.argument('keys', nargs=-1)
@click.option('--format', default=OutputFormat.BARE, type=click.Choice([e.value for e in OutputFormat]), help='Output format')
def main(vault, keys, format):
"""
Get a bunch of entries from the vault located at VAULT.
......@@ -84,4 +79,4 @@ def main(
if __name__ == "__main__":
typer.run(main)
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment