Commit 2072cbd3 authored by opara's avatar opara 🙃
Browse files

Merge branch 'keys-list-fixes' into 'main'

arti: Various `arti keys list` doc fixes

See merge request !4125
parents 56c8f2b3 18115a11
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ pub(crate) struct ListArgs {
struct OutputFormat {
    /// Compact format.
    ///
    /// Displays every valid entry on a single line when enabled.
    /// Displays every entry on a single line when enabled.
    #[arg(long, default_value_t = false)]
    compact: bool,
}
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ const CFG_PATH: &str = "./tests/testcases/keys/keys.in/keys.toml";
const CFG_PATH_WITH_CTOR: &str = "./tests/testcases/keys/conf/keys.toml";

/// A client of an `ArtiNativeKeystore`.
// IDEA: Consider using the
// TODO: Consider using the
// [const_format](https://docs.rs/const_format/latest/const_format/index.html) crate to reduce duplication.
const CLIENT_KEY: &str = "Keystore ID: arti
Role: ks_hsc_desc_enc
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ Options:
      --compact
          Compact format.
          
          Displays every valid entry on a single line when enabled.
          Displays every entry on a single line when enabled.

  -o <KEY=VALUE>
          Override config file parameters, using TOML-like syntax.
+2 −1
Original line number Diff line number Diff line
@@ -18,7 +18,8 @@ pub(crate) enum ArtiNativeKeystoreError {
    Filesystem(#[from] FilesystemError),

    /// Found a key with an invalid path.
    // IDEA: Should we expose the underlying MalformedPathError? The current
    //
    // TODO: Should we expose the underlying MalformedPathError? The current
    // message "Key has invalid path" is too vague.
    #[error("Key has invalid path: {path}")]
    MalformedPath {
+7 −2
Original line number Diff line number Diff line
@@ -34,14 +34,19 @@ By default the command displays the content of all the keystores. If the
flag `--keystore-id` is provided, only the content of the specified
keystore will be displayed.

This command provides a way of listing both valid and broken entries.
This command provides a way of listing both valid and broken
(i.e. unrecognized by Arti, or otherwise corrupt) entries.

Some of the information displayed by `keys list` can be used as input for other
commands. For instance: "Location", is the raw identifier of the entry; and
"Keystore ID", the identifier, of the keystore. These can be used together
with `arti keys-raw remove-by-id`.

`keys list` will supports alternative output formats. Currently, only `compact` is available, with more formats coming soon.
By default, `keys list` pretty-prints human-readable output.
You can use the `--compact` option to get it to display
a more compact representation.

> NOTE: in the future, we plan to support machine-readable output too

Example usage: