Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rename the iroh-ctl crate to the iroh crate #321

Merged
merged 2 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[workspace]
members = [
"iroh",
"iroh-api",
"iroh-bitswap",
"iroh-car",
"iroh-ctl",
"iroh-rpc-client",
"iroh-rpc-types",
"iroh-gateway",
Expand Down
11 changes: 3 additions & 8 deletions iroh-ctl/Cargo.toml → iroh/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
[package]
name = "iroh-ctl"
name = "iroh"
version = "0.1.0"
edition = "2021"
authors = ["Kasey Huizinga <klhuizinga@gmail.com>", "Martijn Faassen <faassen@startifact.com>"]
license = "Apache-2.0/MIT"
repository = "https://github.com/n0-computer/iroh"
description = "Command line interface for interacting with iroh."
default-run = "iroh"

[features]
testing = []

[[bin]]
path = "src/main.rs"
name = "iroh"

[dependencies]
anyhow = "1.0"
futures = "0.3.21"
Expand All @@ -30,12 +25,12 @@ iroh-api = { path = "../iroh-api"}
[dev-dependencies]
trycmd = "0.13.7"
iroh-api = { path = "../iroh-api", features = ["testing"] }
# We want to compile `iroh-ctl` in test mode, but we can't specify that yet:
# We want to compile `iroh` in test mode, but we can't specify that yet:
# https://github.com/rust-lang/cargo/issues/1982
# This is a workaround for enabling features only during testing:
# https://github.com/DesmondWillowbrook/cargo-optional-features-for-testing-and-examples
# It is needed to have trycmd invoke a version of the iroh CLI in testing
# mode. trycmd needs to have an actual binary to invoke.
# Unfortunately this also turns on the feature during development, which may be
# confusing. See the comments in `run.rs` surrounding this.
iroh-ctl = { path = ".", features = ["testing"] }
iroh = { path = ".", features = ["testing"] }
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion iroh-ctl/src/main.rs → iroh/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use clap::Parser;

#[tokio::main(flavor = "multi_thread")]
async fn main() -> Result<()> {
let cli = iroh_ctl::run::Cli::parse();
let cli = iroh::run::Cli::parse();
// the `run` method exists in two versions:
// When using the `testing` feature, the
// version of `run` designed for testing purposes using mocked test
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions iroh-ctl/tests/cli_tests.rs → iroh/tests/cli_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ async fn get_cli_test() {
.case("tests/cmd/get.trycmd")
.run();
}

#[tokio::test]
async fn version_cli_test() {
trycmd::TestCases::new()
.case("tests/cmd/version.trycmd")
.run();
}
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions iroh/tests/cmd/version.trycmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
We can get the version with `--version`:

```
$ iroh --version
iroh 0.1.0

```

We can also get it with `-V`:

```
$ iroh -V
iroh 0.1.0

```