Skip to content

Commit

Permalink
[eclipse-iceoryx#98] Make CLI tools a single easy-to-install crate
Browse files Browse the repository at this point in the history
  • Loading branch information
orecham committed Sep 21, 2024
1 parent 0f78951 commit 7248091
Show file tree
Hide file tree
Showing 18 changed files with 56 additions and 119 deletions.
9 changes: 3 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ members = [
"iceoryx2-pal/posix/",
"iceoryx2-pal/configuration/",

"iceoryx2-cli/iox2",
"iceoryx2-cli/iox2-node",
"iceoryx2-cli/iox2-service",
"iceoryx2-cli/utils",
"iceoryx2-cli",

"examples",

Expand Down Expand Up @@ -62,15 +59,15 @@ iceoryx2-pal-concurrency-sync = { version = "0.3.0", path = "iceoryx2-pal/concur
iceoryx2-pal-posix = { version = "0.3.0", path = "iceoryx2-pal/posix/" }
iceoryx2-pal-configuration = { version = "0.3.0", path = "iceoryx2-pal/configuration/" }

iceoryx2-cli-utils = { version = "0.3.0", path = "iceoryx2-cli/utils/" }

iceoryx2-cal = { version = "0.3.0", path = "iceoryx2-cal" }

iceoryx2-ffi = { version = "0.3.0", path = "iceoryx2-ffi/ffi" }
iceoryx2-ffi-macros = { version = "0.3.0", path = "iceoryx2-ffi/ffi-macros" }

iceoryx2 = { version = "0.3.0", path = "iceoryx2/" }

iceoryx2-cli = { version = "0.3.0", path = "iceoryx2_cli/"}

anyhow = { version = "1.0.86" }
bindgen = { version = "0.69.4" }
bitflags = { version = "2.5.0" }
Expand Down
36 changes: 31 additions & 5 deletions iceoryx2-cli/iox2/Cargo.toml → iceoryx2-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "iox2"
description = "CLI entry-point"
name = "iceoryx2-cli"
description = "CLI tools for iceoryx2"

categories = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
Expand All @@ -10,15 +11,40 @@ repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }

[package.metadata]
default-run = "iox2"

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

[[bin]]
name = "iox2-node"
path = "iox2-node/src/main.rs"

[[bin]]
name = "iox2-service"
path = "iox2-service/src/main.rs"

[lib]
name = "iceoryx2_cli"
path = "lib/src/lib.rs"

[dependencies]
iceoryx2-cli-utils = { workspace = true }
iceoryx2 = { workspace = true }
iceoryx2-bb-log = { workspace = true }
iceoryx2-pal-posix = {workspace = true}

anyhow = { workspace = true }
better-panic = { workspace = true }
colored = { workspace = true }
cargo_metadata = { workspace = true }
clap = { workspace = true }
colored = { workspace = true }
human-panic = { workspace = true }
cargo_metadata = { workspace = true }
serde = { workspace = true }
serde_yaml = { workspace = true }
serde_json = { workspace = true }
ron = { workspace = true }

[dev-dependencies]
iceoryx2-bb-testing = { workspace = true }
Expand Down
23 changes: 0 additions & 23 deletions iceoryx2-cli/iox2-node/Cargo.toml

This file was deleted.

8 changes: 4 additions & 4 deletions iceoryx2-cli/iox2-node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ use clap::Parser;
use clap::Subcommand;
use clap::ValueEnum;

use iceoryx2_cli_utils::help_template;
use iceoryx2_cli_utils::Format;
use iceoryx2_cli::help_template;
use iceoryx2_cli::Format;
use iceoryx2_pal_posix::posix::pid_t;

#[derive(Parser)]
#[command(
name = "iox2-nodes",
name = "iox2-node",
about = "Query information about iceoryx2 nodes",
long_about = None,
version = env!("CARGO_PKG_VERSION"),
disable_help_subcommand = true,
arg_required_else_help = false,
help_template = help_template("iox2-nodes", false),
help_template = help_template("iox2 node", false),
)]
pub struct Cli {
#[clap(subcommand)]
Expand Down
10 changes: 5 additions & 5 deletions iceoryx2-cli/iox2-node/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

use anyhow::{Context, Error, Result};
use iceoryx2::prelude::*;
use iceoryx2_cli_utils::output::NodeDescription;
use iceoryx2_cli_utils::output::NodeDescriptor;
use iceoryx2_cli_utils::output::NodeList;
use iceoryx2_cli_utils::Filter;
use iceoryx2_cli_utils::Format;
use iceoryx2_cli::output::NodeDescription;
use iceoryx2_cli::output::NodeDescriptor;
use iceoryx2_cli::output::NodeList;
use iceoryx2_cli::Filter;
use iceoryx2_cli::Format;

use crate::cli::NodeIdentifier;
use crate::cli::OutputFilter;
Expand Down
4 changes: 2 additions & 2 deletions iceoryx2-cli/iox2-node/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use crate::cli::StateFilter;
use iceoryx2::node::NodeState;
use iceoryx2::node::NodeView;
use iceoryx2::service::ipc::Service;
use iceoryx2_cli_utils::output::NodeIdString;
use iceoryx2_cli_utils::Filter;
use iceoryx2_cli::output::NodeIdString;
use iceoryx2_cli::Filter;

impl Filter<NodeState<Service>> for NodeIdentifier {
fn matches(&self, node: &NodeState<Service>) -> bool {
Expand Down
23 changes: 0 additions & 23 deletions iceoryx2-cli/iox2-service/Cargo.toml

This file was deleted.

8 changes: 4 additions & 4 deletions iceoryx2-cli/iox2-service/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ use clap::Parser;
use clap::Subcommand;
use clap::ValueEnum;

use iceoryx2_cli_utils::help_template;
use iceoryx2_cli_utils::Format;
use iceoryx2_cli::help_template;
use iceoryx2_cli::Format;

#[derive(Parser)]
#[command(
name = "iox2-services",
name = "iox2-service",
about = "Query information about iceoryx2 services",
long_about = None,
version = env!("CARGO_PKG_VERSION"),
disable_help_subcommand = true,
arg_required_else_help = false,
help_template = help_template("iox2-services", false),
help_template = help_template("iox2 service", false),
)]
pub struct Cli {
#[clap(subcommand)]
Expand Down
10 changes: 5 additions & 5 deletions iceoryx2-cli/iox2-service/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@

use anyhow::{Context, Error, Result};
use iceoryx2::prelude::*;
use iceoryx2_cli_utils::output::ServiceDescription;
use iceoryx2_cli_utils::output::ServiceDescriptor;
use iceoryx2_cli_utils::output::ServiceList;
use iceoryx2_cli_utils::Filter;
use iceoryx2_cli_utils::Format;
use iceoryx2_cli::output::ServiceDescription;
use iceoryx2_cli::output::ServiceDescriptor;
use iceoryx2_cli::output::ServiceList;
use iceoryx2_cli::Filter;
use iceoryx2_cli::Format;

use crate::cli::OutputFilter;

Expand Down
2 changes: 1 addition & 1 deletion iceoryx2-cli/iox2-service/src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::cli::OutputFilter;
use iceoryx2::service::ipc::Service;
use iceoryx2::service::static_config::messaging_pattern::MessagingPattern;
use iceoryx2::service::ServiceDetails;
use iceoryx2_cli_utils::Filter;
use iceoryx2_cli::Filter;

impl Filter<ServiceDetails<Service>> for MessagingPatternFilter {
fn matches(&self, service: &ServiceDetails<Service>) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion iceoryx2-cli/iox2/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use clap::Parser;

use iceoryx2_cli_utils::help_template;
use iceoryx2_cli::help_template;

#[derive(Parser, Debug)]
#[command(
Expand Down
14 changes: 0 additions & 14 deletions iceoryx2-cli/iox2/src/lib.rs

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 0 additions & 26 deletions iceoryx2-cli/utils/Cargo.toml

This file was deleted.

0 comments on commit 7248091

Please sign in to comment.