From 8cd6bb99cc51583b8aba5dd2b2090372035a73bb Mon Sep 17 00:00:00 2001 From: eikek <701128+eikek@users.noreply.github.com> Date: Wed, 3 Jul 2024 14:12:06 +0200 Subject: [PATCH] Rename binary to rnk (#6) --- Cargo.lock | 46 ++++++++++++++++----------------- Cargo.toml | 2 +- docs/index.md | 13 ++++++---- mkdocs.sh | 2 +- src/cli/cmd/shell_completion.rs | 2 +- src/cli/cmd/userdoc.rs | 6 ++--- src/cli/opts.rs | 2 +- src/httpclient.rs | 2 +- src/main.rs | 6 ++--- tests/common/mod.rs | 2 +- tests/version.rs | 2 +- 11 files changed, 44 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c344ea0..2d0dbf4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1339,29 +1339,6 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" -[[package]] -name = "renku-cli" -version = "0.1.0-nightly" -dependencies = [ - "assert_cmd", - "clap", - "clap_complete", - "comrak", - "console", - "env_logger", - "futures", - "log", - "openssl", - "predicates", - "regex", - "reqwest", - "serde", - "serde_json", - "snafu", - "tokio", - "vergen", -] - [[package]] name = "reqwest" version = "0.12.5" @@ -1424,6 +1401,29 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rnk" +version = "0.1.0-nightly" +dependencies = [ + "assert_cmd", + "clap", + "clap_complete", + "comrak", + "console", + "env_logger", + "futures", + "log", + "openssl", + "predicates", + "regex", + "reqwest", + "serde", + "serde_json", + "snafu", + "tokio", + "vergen", +] + [[package]] name = "rustc-demangle" version = "0.1.24" diff --git a/Cargo.toml b/Cargo.toml index 014a02f..52868c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "renku-cli" +name = "rnk" description = "A command line interface to the Renku platform" homepage = "https://renkulab.io/" version = "0.1.0-nightly" diff --git a/docs/index.md b/docs/index.md index fdf1868..8879598 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,12 +1,12 @@ # Renku CLI -This is the documentation for `renku-cli` the command line interface -to the Renku platform. +This is the documentation for the command line interface to the Renku +platform. ## Installation -The binary name for the renku-cli is `renku-cli`. +The binary name for the renku-cli is `rnk`. ### Manual Download @@ -17,9 +17,12 @@ If you run on MacOS, download the `*-darwin` binary. If you run some form of linux, try `*-amd64` or `*-aarch64`. Last for Windows use the `*-windows` binary. +Once downloaded, you can simply execute it without any further +installation step. + ### Nix User -If you are a nix user and have flakes enabled, you can install renku-cli +If you are a nix user and have flakes enabled, you can install rnk from this repository: ``` @@ -46,5 +49,5 @@ get an overview of possible commands, run the binary without any options or adding `--help`. ``` bash renku-cli -renku-cli --help +rnk --help ``` diff --git a/mkdocs.sh b/mkdocs.sh index 5bc5cc7..563f49e 100755 --- a/mkdocs.sh +++ b/mkdocs.sh @@ -3,4 +3,4 @@ set -e cargo build --release -cargo run --features user-doc -- user-doc --output-dir target/docs --overwrite --renku-cli target/release/renku-cli docs/ +cargo run --features user-doc -- user-doc --output-dir target/docs --overwrite --renku-cli target/release/rnk docs/ diff --git a/src/cli/cmd/shell_completion.rs b/src/cli/cmd/shell_completion.rs index 2194251..d415ca2 100644 --- a/src/cli/cmd/shell_completion.rs +++ b/src/cli/cmd/shell_completion.rs @@ -10,7 +10,7 @@ pub struct Input { pub shell: GeneratorChoice, /// The binary name. - #[arg(long, default_value = "renku-cli")] + #[arg(long, default_value = "rnk")] pub binary: String, } diff --git a/src/cli/cmd/userdoc.rs b/src/cli/cmd/userdoc.rs index 08e16b2..4dec975 100644 --- a/src/cli/cmd/userdoc.rs +++ b/src/cli/cmd/userdoc.rs @@ -47,8 +47,8 @@ pub struct Input { #[arg(long, group = "output")] pub output_dir: Option, - /// The renku-cli binary program to use for running the snippets. - /// By default it will use itself. + /// The rnk binary program to use for running the snippets. By + /// default it will use itself. #[arg(long)] pub renku_cli: Option, @@ -207,7 +207,7 @@ fn write_to_file(file: &Path, content: &str, overwrite: bool, append: bool) -> R Ok(()) } -/// Process a markdown file by executing all included renku-cli +/// Process a markdown file by executing all included rnk /// commands and inserting the results. /// /// The commands are taken from (fenced) code blocks marked with diff --git a/src/cli/opts.rs b/src/cli/opts.rs index 1db9bb7..5f888de 100644 --- a/src/cli/opts.rs +++ b/src/cli/opts.rs @@ -64,7 +64,7 @@ pub enum SubCommand { /// Repository: https://github.com/SwissDataScienceCenter/renku-cli /// Issue tracker: https://github.com/SwissDataScienceCenter/renku-cli/issues #[derive(Parser, Debug)] -#[command(name = "renku-cli", version)] +#[command(name = "rnk", version)] pub struct MainOpts { #[clap(flatten)] pub common_opts: CommonOpts, diff --git a/src/httpclient.rs b/src/httpclient.rs index 6d4e096..a51137d 100644 --- a/src/httpclient.rs +++ b/src/httpclient.rs @@ -5,7 +5,7 @@ //! # Usage //! //! ```rust -//! use renku_cli::httpclient; +//! use rnk::httpclient; //! let client = httpclient::Client::new( //! "https://renkulab.io", //! httpclient::proxy::ProxySetting::System, diff --git a/src/main.rs b/src/main.rs index e6230b6..446e0eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use renku_cli::error::{Error, Result}; +use rnk::error::{Error, Result}; use std::env; use std::process; @@ -15,7 +15,7 @@ async fn main() { } async fn execute() -> Result<()> { - let opts = renku_cli::read_args(); + let opts = rnk::read_args(); let remove_env = match opts.common_opts.verbose { 1 => set_log_level("info"), n => { @@ -28,7 +28,7 @@ async fn execute() -> Result<()> { }; env_logger::init(); - let result = renku_cli::execute_cmd(opts).await; + let result = rnk::execute_cmd(opts).await; if remove_env { env::remove_var(LOG_LEVEL); } diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 9467b0e..615c2e5 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -27,7 +27,7 @@ impl std::convert::From for Error { pub type Result = std::result::Result; pub fn mk_cmd() -> Result { - let mut cmd = Command::cargo_bin("renku-cli")?; + let mut cmd = Command::cargo_bin("rnk")?; cmd.args(["--renku-url", "https://ci-renku-3668.dev.renku.ch"]); //use mock url? Ok(cmd) } diff --git a/tests/version.rs b/tests/version.rs index bc2a1a4..b7bc9a0 100644 --- a/tests/version.rs +++ b/tests/version.rs @@ -2,7 +2,7 @@ mod common; use crate::common::*; use assert_cmd::prelude::*; use predicates::prelude::*; -use renku_cli::cli::BuildInfo; +use rnk::cli::BuildInfo; #[test] #[ignore = "needs a server"]