diff --git a/libkeyringctl/cli.py b/libkeyringctl/cli.py index 020f64b..e639097 100644 --- a/libkeyringctl/cli.py +++ b/libkeyringctl/cli.py @@ -15,6 +15,7 @@ from .keyring import convert from .keyring import export from .keyring import inspect_keyring from .keyring import list_keyring +from .types import Keyring from .types import TrustFilter from .util import absolute_path from .util import cwd @@ -32,6 +33,12 @@ parser.add_argument( default=False, help="force the execution of subcommands (e.g. overwriting of files)", ) +parser.add_argument( + "--keyring", + choices=[e.value for e in Keyring], + default=Keyring.packager.value, + help="Keyring to use", +) subcommands = parser.add_subparsers(dest="subcommand") convert_parser = subcommands.add_parser( @@ -143,6 +150,8 @@ def main() -> None: # noqa: ignore=C901 with TemporaryDirectory(prefix="arch-keyringctl-") as tempdir: project_root = Path(".").absolute() keyring_root = Path("keyring").absolute() + if args.keyring != "packager": + keyring_root = Path(args.keyring).absolute() working_dir = Path(tempdir) debug(f"Working directory: {working_dir}") with cwd(working_dir): diff --git a/libkeyringctl/types.py b/libkeyringctl/types.py index a19c1a9..e7f791c 100644 --- a/libkeyringctl/types.py +++ b/libkeyringctl/types.py @@ -10,6 +10,12 @@ Username = NewType("Username", str) PacketKind = NewType("PacketKind", str) +class Keyring(Enum): + packager = "packager" + support = "support" + service = "service" + + class Trust(Enum): unknown = auto() revoked = auto()