Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle-cli: Remove deprecate modules
✗ CI failure Matthias Beyer committed 8 months ago
commit 52e3664db1508a0f8711f2815679646456584fb6
parent dbaa810c4eada76ccd920b504968559154e7590b
3 passed 1 failed (4 total) View logs
7 files changed +82 -258
modified crates/radicle-cli/src/commands.rs
@@ -31,93 +31,3 @@ pub mod watch;

#[path = "commands/self.rs"]
pub mod rad_self;
-

-
#[deprecated(note = "Use module name 'auth' instead")]
-
pub use auth as rad_auth;
-

-
#[deprecated(note = "Use module name 'block' instead")]
-
pub use block as rad_block;
-

-
#[deprecated(note = "Use module name 'checkout' instead")]
-
pub use checkout as rad_checkout;
-

-
#[deprecated(note = "Use module name 'clean' instead")]
-
pub use clean as rad_clean;
-

-
#[deprecated(note = "Use module name 'clone' instead")]
-
pub use clone as rad_clone;
-

-
#[deprecated(note = "Use module name 'cob' instead")]
-
pub use cob as rad_cob;
-

-
#[deprecated(note = "Use module name 'config' instead")]
-
pub use config as rad_config;
-

-
#[deprecated(note = "Use module name 'debug' instead")]
-
pub use debug as rad_debug;
-

-
#[deprecated(note = "Use module name 'diff' instead")]
-
pub use diff as rad_diff;
-

-
#[deprecated(note = "Use module name 'follow' instead")]
-
pub use follow as rad_follow;
-

-
#[deprecated(note = "Use module name 'fork' instead")]
-
pub use fork as rad_fork;
-

-
#[deprecated(note = "Use module name 'help' instead")]
-
pub use help as rad_help;
-

-
#[deprecated(note = "Use module name 'id' instead")]
-
pub use id as rad_id;
-

-
#[deprecated(note = "Use module name 'inbox' instead")]
-
pub use inbox as rad_inbox;
-

-
#[deprecated(note = "Use module name 'init' instead")]
-
pub use init as rad_init;
-

-
#[deprecated(note = "Use module name 'inspect' instead")]
-
pub use inspect as rad_inspect;
-

-
#[deprecated(note = "Use module name 'issue' instead")]
-
pub use issue as rad_issue;
-

-
#[deprecated(note = "Use module name 'ls' instead")]
-
pub use ls as rad_ls;
-

-
#[deprecated(note = "Use module name 'node' instead")]
-
pub use node as rad_node;
-

-
#[deprecated(note = "Use module name 'patch' instead")]
-
pub use patch as rad_patch;
-

-
#[deprecated(note = "Use module name 'path' instead")]
-
pub use path as rad_path;
-

-
#[deprecated(note = "Use module name 'publish' instead")]
-
pub use publish as rad_publish;
-

-
#[deprecated(note = "Use module name 'remote' instead")]
-
pub use remote as rad_remote;
-

-
#[deprecated(note = "Use module name 'seed' instead")]
-
pub use seed as rad_seed;
-

-
#[deprecated(note = "Use module name 'stats' instead")]
-
pub use stats as rad_stats;
-

-
#[deprecated(note = "Use module name 'sync' instead")]
-
pub use sync as rad_sync;
-

-
#[deprecated(note = "Use module name 'unblock' instead")]
-
pub use unblock as rad_unblock;
-

-
#[deprecated(note = "Use module name 'unfollow' instead")]
-
pub use unfollow as rad_unfollow;
-

-
#[deprecated(note = "Use module name 'unseed' instead")]
-
pub use unseed as rad_unseed;
-

-
#[deprecated(note = "Use module name 'watch' instead")]
-
pub use watch as rad_watch;
modified crates/radicle-cli/src/commands/clone.rs
@@ -21,8 +21,8 @@ use radicle::storage;
use radicle::storage::RemoteId;
use radicle::storage::{HasRepoId, RepositoryError};

-
use crate::commands::rad_checkout as checkout;
-
use crate::commands::rad_sync as sync;
+
use crate::commands::checkout;
+
use crate::commands::sync;
use crate::node::SyncSettings;
use crate::project;
use crate::terminal as term;
modified crates/radicle-cli/src/commands/help.rs
@@ -3,8 +3,6 @@ use std::ffi::OsString;
use crate::terminal as term;
use crate::terminal::args::{Args, Error, Help};

-
use super::*;
-

pub const HELP: Help = Help {
    name: "help",
    description: "CLI help",
@@ -13,32 +11,32 @@ pub const HELP: Help = Help {
};

const COMMANDS: &[Help] = &[
-
    rad_auth::HELP,
-
    rad_block::HELP,
-
    rad_checkout::HELP,
-
    rad_clone::HELP,
-
    rad_config::HELP,
-
    rad_fork::HELP,
-
    rad_help::HELP,
-
    rad_id::HELP,
-
    rad_init::HELP,
-
    rad_inbox::HELP,
-
    rad_inspect::HELP,
-
    rad_issue::HELP,
-
    rad_ls::HELP,
-
    rad_node::HELP,
-
    rad_patch::HELP,
-
    rad_path::HELP,
-
    rad_clean::HELP,
-
    rad_self::HELP,
-
    rad_seed::HELP,
-
    rad_follow::HELP,
-
    rad_unblock::HELP,
-
    rad_unfollow::HELP,
-
    rad_unseed::HELP,
-
    rad_remote::HELP,
-
    rad_stats::HELP,
-
    rad_sync::HELP,
+
    crate::commands::auth::HELP,
+
    crate::commands::block::HELP,
+
    crate::commands::checkout::HELP,
+
    crate::commands::clone::HELP,
+
    crate::commands::config::HELP,
+
    crate::commands::fork::HELP,
+
    crate::commands::help::HELP,
+
    crate::commands::id::HELP,
+
    crate::commands::init::HELP,
+
    crate::commands::inbox::HELP,
+
    crate::commands::inspect::HELP,
+
    crate::commands::issue::HELP,
+
    crate::commands::ls::HELP,
+
    crate::commands::node::HELP,
+
    crate::commands::patch::HELP,
+
    crate::commands::path::HELP,
+
    crate::commands::clean::HELP,
+
    crate::commands::rad_self::HELP,
+
    crate::commands::seed::HELP,
+
    crate::commands::follow::HELP,
+
    crate::commands::unblock::HELP,
+
    crate::commands::unfollow::HELP,
+
    crate::commands::unseed::HELP,
+
    crate::commands::remote::HELP,
+
    crate::commands::stats::HELP,
+
    crate::commands::sync::HELP,
];

#[derive(Default)]
modified crates/radicle-cli/src/commands/init.rs
@@ -448,7 +448,7 @@ fn sync(
    // Connect to preferred seeds in case we aren't connected.
    for seed in config.preferred_seeds.iter() {
        if !sessions.iter().any(|s| s.nid == seed.id) {
-
            commands::rad_node::control::connect(
+
            commands::node::control::connect(
                node,
                seed.id,
                seed.addr.clone(),
modified crates/radicle-cli/src/commands/remote/add.rs
@@ -6,9 +6,9 @@ use radicle::prelude::*;
use radicle::Profile;
use radicle_crypto::PublicKey;

-
use crate::commands::rad_checkout as checkout;
-
use crate::commands::rad_follow as follow;
-
use crate::commands::rad_sync as sync;
+
use crate::commands::checkout;
+
use crate::commands::follow;
+
use crate::commands::sync;
use crate::node::SyncSettings;
use crate::project::SetupRemote;

modified crates/radicle-cli/src/commands/seed.rs
@@ -11,7 +11,7 @@ use radicle::node::Handle;
use radicle::{prelude::*, Node};
use radicle_term::Element as _;

-
use crate::commands::rad_sync as sync;
+
use crate::commands::sync;
use crate::node::SyncSettings;
use crate::terminal as term;
use crate::terminal::args::{Args, Error, Help};
modified crates/radicle-cli/src/main.rs
@@ -100,7 +100,7 @@ fn print_help() -> anyhow::Result<()> {
    println!("{DESCRIPTION}");
    println!();

-
    rad_help::run(Default::default(), term::DefaultContext)
+
    help::run(Default::default(), term::DefaultContext)
}

fn run(command: Command) -> Result<(), Option<anyhow::Error>> {
@@ -136,148 +136,82 @@ fn run(command: Command) -> Result<(), Option<anyhow::Error>> {
fn run_other(exe: &str, args: &[OsString]) -> Result<(), Option<anyhow::Error>> {
    match exe {
        "auth" => {
-
            term::run_command_args::<rad_auth::Options, _>(
-
                rad_auth::HELP,
-
                rad_auth::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<auth::Options, _>(auth::HELP, auth::run, args.to_vec());
        }
        "block" => {
-
            term::run_command_args::<rad_block::Options, _>(
-
                rad_block::HELP,
-
                rad_block::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<block::Options, _>(block::HELP, block::run, args.to_vec());
        }
        "checkout" => {
-
            term::run_command_args::<rad_checkout::Options, _>(
-
                rad_checkout::HELP,
-
                rad_checkout::run,
+
            term::run_command_args::<checkout::Options, _>(
+
                checkout::HELP,
+
                checkout::run,
                args.to_vec(),
            );
        }
        "clone" => {
-
            term::run_command_args::<rad_clone::Options, _>(
-
                rad_clone::HELP,
-
                rad_clone::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<clone::Options, _>(clone::HELP, clone::run, args.to_vec());
        }
        "cob" => {
-
            term::run_command_args::<rad_cob::Options, _>(
-
                rad_cob::HELP,
-
                rad_cob::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<cob::Options, _>(cob::HELP, cob::run, args.to_vec());
        }
        "config" => {
-
            term::run_command_args::<rad_config::Options, _>(
-
                rad_config::HELP,
-
                rad_config::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<config::Options, _>(config::HELP, config::run, args.to_vec());
        }
        "diff" => {
-
            term::run_command_args::<rad_diff::Options, _>(
-
                rad_diff::HELP,
-
                rad_diff::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<diff::Options, _>(diff::HELP, diff::run, args.to_vec());
        }
        "debug" => {
-
            term::run_command_args::<rad_debug::Options, _>(
-
                rad_debug::HELP,
-
                rad_debug::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<debug::Options, _>(debug::HELP, debug::run, args.to_vec());
        }
        "follow" => {
-
            term::run_command_args::<rad_follow::Options, _>(
-
                rad_follow::HELP,
-
                rad_follow::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<follow::Options, _>(follow::HELP, follow::run, args.to_vec());
        }
        "fork" => {
-
            term::run_command_args::<rad_fork::Options, _>(
-
                rad_fork::HELP,
-
                rad_fork::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<fork::Options, _>(fork::HELP, fork::run, args.to_vec());
        }
        "help" => {
-
            term::run_command_args::<rad_help::Options, _>(
-
                rad_help::HELP,
-
                rad_help::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<help::Options, _>(help::HELP, help::run, args.to_vec());
        }
        "id" => {
-
            term::run_command_args::<rad_id::Options, _>(rad_id::HELP, rad_id::run, args.to_vec());
+
            term::run_command_args::<id::Options, _>(id::HELP, id::run, args.to_vec());
+
        }
+
        "inbox" => {
+
            term::run_command_args::<inbox::Options, _>(inbox::HELP, inbox::run, args.to_vec())
        }
-
        "inbox" => term::run_command_args::<rad_inbox::Options, _>(
-
            rad_inbox::HELP,
-
            rad_inbox::run,
-
            args.to_vec(),
-
        ),
        "init" => {
-
            term::run_command_args::<rad_init::Options, _>(
-
                rad_init::HELP,
-
                rad_init::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<init::Options, _>(init::HELP, init::run, args.to_vec());
        }
        "inspect" => {
-
            term::run_command_args::<rad_inspect::Options, _>(
-
                rad_inspect::HELP,
-
                rad_inspect::run,
+
            term::run_command_args::<inspect::Options, _>(
+
                inspect::HELP,
+
                inspect::run,
                args.to_vec(),
            );
        }
        "issue" => {
-
            term::run_command_args::<rad_issue::Options, _>(
-
                rad_issue::HELP,
-
                rad_issue::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<issue::Options, _>(issue::HELP, issue::run, args.to_vec());
        }
        "ls" => {
-
            term::run_command_args::<rad_ls::Options, _>(rad_ls::HELP, rad_ls::run, args.to_vec());
+
            term::run_command_args::<ls::Options, _>(ls::HELP, ls::run, args.to_vec());
        }
        "node" => {
-
            term::run_command_args::<rad_node::Options, _>(
-
                rad_node::HELP,
-
                rad_node::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<node::Options, _>(node::HELP, node::run, args.to_vec());
        }
        "patch" => {
-
            term::run_command_args::<rad_patch::Options, _>(
-
                rad_patch::HELP,
-
                rad_patch::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<patch::Options, _>(patch::HELP, patch::run, args.to_vec());
        }
        "path" => {
-
            term::run_command_args::<rad_path::Options, _>(
-
                rad_path::HELP,
-
                rad_path::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<path::Options, _>(path::HELP, path::run, args.to_vec());
        }
        "publish" => {
-
            term::run_command_args::<rad_publish::Options, _>(
-
                rad_publish::HELP,
-
                rad_publish::run,
+
            term::run_command_args::<publish::Options, _>(
+
                publish::HELP,
+
                publish::run,
                args.to_vec(),
            );
        }
        "clean" => {
-
            term::run_command_args::<rad_clean::Options, _>(
-
                rad_clean::HELP,
-
                rad_clean::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<clean::Options, _>(clean::HELP, clean::run, args.to_vec());
        }
        "self" => {
            term::run_command_args::<rad_self::Options, _>(
@@ -287,55 +221,37 @@ fn run_other(exe: &str, args: &[OsString]) -> Result<(), Option<anyhow::Error>>
            );
        }
        "sync" => {
-
            term::run_command_args::<rad_sync::Options, _>(
-
                rad_sync::HELP,
-
                rad_sync::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<sync::Options, _>(sync::HELP, sync::run, args.to_vec());
        }
        "seed" => {
-
            term::run_command_args::<rad_seed::Options, _>(
-
                rad_seed::HELP,
-
                rad_seed::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<seed::Options, _>(seed::HELP, seed::run, args.to_vec());
        }
        "unblock" => {
-
            term::run_command_args::<rad_unblock::Options, _>(
-
                rad_unblock::HELP,
-
                rad_unblock::run,
+
            term::run_command_args::<unblock::Options, _>(
+
                unblock::HELP,
+
                unblock::run,
                args.to_vec(),
            );
        }
        "unfollow" => {
-
            term::run_command_args::<rad_unfollow::Options, _>(
-
                rad_unfollow::HELP,
-
                rad_unfollow::run,
+
            term::run_command_args::<unfollow::Options, _>(
+
                unfollow::HELP,
+
                unfollow::run,
                args.to_vec(),
            );
        }
        "unseed" => {
-
            term::run_command_args::<rad_unseed::Options, _>(
-
                rad_unseed::HELP,
-
                rad_unseed::run,
-
                args.to_vec(),
-
            );
+
            term::run_command_args::<unseed::Options, _>(unseed::HELP, unseed::run, args.to_vec());
+
        }
+
        "remote" => {
+
            term::run_command_args::<remote::Options, _>(remote::HELP, remote::run, args.to_vec())
+
        }
+
        "stats" => {
+
            term::run_command_args::<stats::Options, _>(stats::HELP, stats::run, args.to_vec())
+
        }
+
        "watch" => {
+
            term::run_command_args::<watch::Options, _>(watch::HELP, watch::run, args.to_vec())
        }
-
        "remote" => term::run_command_args::<rad_remote::Options, _>(
-
            rad_remote::HELP,
-
            rad_remote::run,
-
            args.to_vec(),
-
        ),
-
        "stats" => term::run_command_args::<rad_stats::Options, _>(
-
            rad_stats::HELP,
-
            rad_stats::run,
-
            args.to_vec(),
-
        ),
-
        "watch" => term::run_command_args::<rad_watch::Options, _>(
-
            rad_watch::HELP,
-
            rad_watch::run,
-
            args.to_vec(),
-
        ),
        other => {
            let exe = format!("{NAME}-{exe}");
            let status = process::Command::new(exe).args(args).status();