Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
cli: Rename all `RepoId` args to `repo`
Lorenz Leutgeb committed 12 days ago
commit f2e96c96cec6315d95608d3a1e93b1a215eb6abd
parent 07c6244
8 files changed +18 -16
modified crates/radicle-cli/src/commands/fork.rs
@@ -14,7 +14,7 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
    let signer = profile.signer()?;
    let storage = &profile.storage;

-
    let rid = match args.rid {
+
    let rid = match args.repo {
        Some(rid) => rid,
        None => {
            let (_, rid) = rad::cwd().context("Current directory is not a Radicle repository")?;
modified crates/radicle-cli/src/commands/fork/args.rs
@@ -19,7 +19,7 @@ pub struct Args {
    ///
    /// [example values: rad:z3Tr6bC7ctEg2EHmLvknUr29mEDLH, z3Tr6bC7ctEg2EHmLvknUr29mEDLH]
    #[arg(value_name = "RID")]
-
    pub(super) rid: Option<RepoId>,
+
    pub(super) repo: Option<RepoId>,
}

#[cfg(test)]
modified crates/radicle-cli/src/commands/node.rs
@@ -72,9 +72,9 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {

            events::run(node, count, timeout)?;
        }
-
        Command::Routing { rid, nid, json } => {
+
        Command::Routing { repo, nid, json } => {
            let store = profile.database()?;
-
            routing::run(&store, rid, nid, json)?;
+
            routing::run(&store, repo, nid, json)?;
        }
        Command::Logs { lines } => control::logs(lines, Some(time::Duration::MAX), &profile)?,
        Command::Start {
modified crates/radicle-cli/src/commands/node/args.rs
@@ -147,8 +147,8 @@ pub(super) enum Command {
        json: bool,

        /// Show the routing table entries for the given RID
-
        #[arg(long)]
-
        rid: Option<RepoId>,
+
        #[arg(long = "rid", value_name = "RID")]
+
        repo: Option<RepoId>,

        /// Show the routing table entries for the given NID
        #[arg(long)]
modified crates/radicle-cli/src/commands/publish.rs
@@ -13,7 +13,7 @@ pub use args::Args;

pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
    let profile = ctx.profile()?;
-
    let rid = match args.rid {
+
    let rid = match args.repo {
        Some(rid) => rid,
        None => radicle::rad::cwd()
            .map(|(_, rid)| rid)
modified crates/radicle-cli/src/commands/publish/args.rs
@@ -21,7 +21,7 @@ pub struct Args {
    ///
    /// [example values: rad:z3Tr6bC7ctEg2EHmLvknUr29mEDLH, z3Tr6bC7ctEg2EHmLvknUr29mEDLH]
    #[arg(value_name = "RID")]
-
    pub(super) rid: Option<RepoId>,
+
    pub(super) repo: Option<RepoId>,
}

#[cfg(test)]
modified crates/radicle-cli/src/commands/sync.rs
@@ -40,8 +40,8 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
    let debug = args.verbose;

    match args.command {
-
        Some(Command::Status { rid, sort_by }) => {
-
            let rid = match rid {
+
        Some(Command::Status { repo, sort_by }) => {
+
            let rid = match repo {
                Some(rid) => rid,
                None => {
                    let (_, rid) = radicle::rad::cwd()
@@ -53,11 +53,11 @@ pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
        }
        None => match SyncMode::from(args.sync) {
            SyncMode::Repo {
-
                rid,
+
                repo,
                settings,
                direction,
            } => {
-
                let rid = match rid {
+
                let rid = match repo {
                    Some(rid) => rid,
                    None => {
                        let (_, rid) = radicle::rad::cwd()
modified crates/radicle-cli/src/commands/sync/args.rs
@@ -107,7 +107,8 @@ pub(super) struct SyncArgs {
    timeout: std::time::Duration,

    /// The repository to perform the synchronizing for [default: cwd]
-
    rid: Option<RepoId>,
+
    #[arg(value_name = "RID")]
+
    repo: Option<RepoId>,

    /// Synchronize with a specific number of seeds
    ///
@@ -178,7 +179,8 @@ pub(super) enum Command {
    #[clap(alias = "s")]
    Status {
        /// The repository to display the status for [default: cwd]
-
        rid: Option<RepoId>,
+
        #[arg(value_name = "RID")]
+
        repo: Option<RepoId>,
        /// Sort the table by column
        #[arg(long, value_name = "FIELD", value_enum, default_value_t)]
        sort_by: SortBy,
@@ -216,7 +218,7 @@ pub(super) enum SyncMode {
    /// Fetch and/or announce a repositories references
    Repo {
        /// The repository being synchronized
-
        rid: Option<RepoId>,
+
        repo: Option<RepoId>,
        /// The settings for fetch/announce
        settings: SyncSettings,
        /// The direction of the synchronization
@@ -244,7 +246,7 @@ impl From<SyncArgs> for SyncMode {
                settings.seeds = args.seeds.into_iter().collect();
            }
            Self::Repo {
-
                rid: args.rid,
+
                repo: args.repo,
                settings,
                direction,
            }