Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: Move `use`s and tighten visibility
Lorenz Leutgeb committed 6 months ago
commit ee7f6b3945fbbc0b141b8042b45c800ba3fc5a19
parent 3d471c69717881387ce70fd1f8e89a4dde163b9c
2 files changed +16 -16
modified crates/radicle-cli/src/commands/inspect.rs
@@ -2,10 +2,6 @@

mod args;

-
pub use args::Args;
-
pub(crate) use args::Target;
-
pub(crate) use args::ABOUT;
-

use std::collections::HashMap;
use std::path::Path;
use std::str::FromStr;
@@ -25,6 +21,10 @@ use crate::terminal as term;
use crate::terminal::json;
use crate::terminal::Element;

+
pub use args::Args;
+
use args::Target;
+
pub(crate) use args::ABOUT;
+

pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
    let rid = match args.repo {
        Some(rid) => {
modified crates/radicle-cli/src/commands/inspect/args.rs
@@ -7,42 +7,42 @@ the current repository is inspected.

#[derive(Debug, Parser)]
#[group(multiple = false)]
-
pub(crate) struct TargetArgs {
+
pub(super) struct TargetArgs {
    /// Inspect the repository's delegates
    #[arg(long)]
-
    pub(crate) delegates: bool,
+
    pub(super) delegates: bool,

    /// Show the history of the repository identity document
    #[arg(long)]
-
    pub(crate) history: bool,
+
    pub(super) history: bool,

    /// Inspect the identity document
    #[arg(long)]
-
    pub(crate) identity: bool,
+
    pub(super) identity: bool,

    /// Inspect the repository's identity payload
    #[arg(long)]
-
    pub(crate) payload: bool,
+
    pub(super) payload: bool,

    /// Inspect the repository's seeding policy
    #[arg(long)]
-
    pub(crate) policy: bool,
+
    pub(super) policy: bool,

    /// Inspect the repository's refs on the local device
    #[arg(long)]
-
    pub(crate) refs: bool,
+
    pub(super) refs: bool,

    /// Return the repository identifier (RID)
    #[arg(long)]
-
    pub(crate) rid: bool,
+
    pub(super) rid: bool,

    /// Inspect the values of `rad/sigrefs` for all remotes of this repository
    #[arg(long)]
-
    pub(crate) sigrefs: bool,
+
    pub(super) sigrefs: bool,

    /// Inspect the repository's visibility
    #[arg(long)]
-
    pub(crate) visibility: bool,
+
    pub(super) visibility: bool,
}

pub(super) enum Target {
@@ -90,8 +90,8 @@ impl From<TargetArgs> for Target {
pub struct Args {
    /// Repository, by RID or by path
    #[arg(value_name = "RID|PATH")]
-
    pub(crate) repo: Option<String>,
+
    pub(super) repo: Option<String>,

    #[clap(flatten)]
-
    pub(crate) target: TargetArgs,
+
    pub(super) target: TargetArgs,
}