Commit c7c9a231 authored by gabi-250's avatar gabi-250 🤸
Browse files

arti: Sort the arti keys list output

This will make the output deterministic and enable us to write some
`trycmd` tests in the form of markdown output snippets.
parent 2072cbd3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -231,6 +231,11 @@ fn run_list_keys(args: ListArgs, client: &InertTorClient) -> Result<()> {
        }
    }

    // Sort the entries to make the output deterministic
    valid_entries.sort_by_key(|(e, _info)| (e.keystore_id(), e.key_path().to_string()));
    unrecognized_entries.sort_by_key(|e| e.entry().raw_id().to_string());
    unrecognized_paths.sort_by_key(|e| e.key_path().to_string());

    for entry in valid_entries {
        if args.output_format.compact {
            println!("{}", entry.0.raw_id());