From 02605edee59663e07775e244e749840def0f62f7 Mon Sep 17 00:00:00 2001 From: Levente Polyak Date: Sat, 23 Oct 2021 16:07:34 +0200 Subject: [PATCH] feature(keyringctl): sort list command for alphabetical listing Only do so when listing all keys, when a filter is provided, like usernames or fingerprints, keep the order to allow a 1:1 mapping. --- keyringctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyringctl b/keyringctl index 2ebd29e..cb3d586 100755 --- a/keyringctl +++ b/keyringctl @@ -1102,7 +1102,7 @@ def list_keyring(keyring_root: Path, sources: Optional[List[Path]] = None, main_ keyring_dir = keyring_root / ("main" if main_keys else "packager") if not sources: - sources = list(keyring_dir.iterdir()) + sources = list(sorted(keyring_dir.iterdir(), key=lambda path: path.name.casefold())) # resolve shorthand username exports for packager keys for index, source in enumerate(sources):