Skip to content

Commit

Permalink
Merge pull request eclipse-iceoryx#106 from orecham/iox2-98-entrypoin…
Browse files Browse the repository at this point in the history
…t-for-iox2-cli

[eclipse-iceoryx#98] Add entrypoint for iox2 cli
  • Loading branch information
elfenpiff authored Jun 24, 2024
2 parents ad6dcd0 + ccbd452 commit 077fb9f
Show file tree
Hide file tree
Showing 18 changed files with 563 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ members = [
"iceoryx2-pal/posix/",
"iceoryx2-pal/configuration/",

"iceoryx2-cli/iox2",
"iceoryx2-cli/iox2-introspect",
"iceoryx2-cli/iox2-processes",
"iceoryx2-cli/iox2-pub",
"iceoryx2-cli/iox2-rpc",
"iceoryx2-cli/iox2-services",
"iceoryx2-cli/iox2-sub",

"examples",

"benchmarks/publish-subscribe",
Expand Down Expand Up @@ -69,7 +77,10 @@ cc = { version = "1.0.98" }
cdr = { version = "0.2.4" }
clap = { version = "4.5.4", features = ["derive"] }
enum-iterator = { version = "2.1.0" }
better-panic = { version = "0.3.0" }
colored = { version = "2.1" }
generic-tests = { version = "0.1.2" }
human-panic = { version = "1.2.3" }
lazy_static = { version = "1.4.0" }
log = { version = "0.4.21" }
once_cell = { version = "1.19.0" }
Expand All @@ -82,6 +93,7 @@ serde_test = { version = "1.0.176" }
sha1_smol = { version = "1.0.0" }
syn = { version = "2.0.66", features = ["full"] }
termsize = { version = "0.1.6" }
thiserror = { version = "1.0.56" }
tiny-fn = { version = "0.1.5" }
toml = { version = "0.8.13" }
tracing = { version = "0.1.40" }
Expand Down
2 changes: 2 additions & 0 deletions doc/release-notes/iceoryx2-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<!-- NOTE: Add new entries sorted by issue number to minimize the possibility of conflicts when merging. -->

* Subscriber buffer size can be reduced [#19](https://github.com/eclipse-iceoryx/iceoryx2/issues/19)
* CLI for iox2 [#98](https://github.com/eclipse-iceoryx/iceoryx2/issues/98)
* Add entrypoint CLI `iox2` in preparation for adding additional CLI commands
* Introduce Nodes [#102](https://github.com/eclipse-iceoryx/iceoryx2/issues/102)
* Implement Serialize,Deserialize for
* `SemanticString`
Expand Down
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-introspect/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "iox2-introspect"
description = "Iceoryx2: CLI for introspecting iceoryx 2 internals"
categories = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-introspect/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2024 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache Software License 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
// which is available at https://opensource.org/licenses/MIT.
//
// SPDX-License-Identifier: Apache-2.0 OR MIT

fn main() {
println!("Not implemented. Stay tuned!");
}
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-processes/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "iox2-processes"
description = "Iceoryx2: CLI for managing iceoryx2 processes"
categories = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-processes/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2024 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache Software License 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
// which is available at https://opensource.org/licenses/MIT.
//
// SPDX-License-Identifier: Apache-2.0 OR MIT

fn main() {
println!("Not implemented. Stay tuned!");
}
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-pub/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "iox2-pub"
description = "Iceoryx2: CLI for publishing to iceoryx2"
categories = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-pub/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2024 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache Software License 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
// which is available at https://opensource.org/licenses/MIT.
//
// SPDX-License-Identifier: Apache-2.0 OR MIT

fn main() {
println!("Not implemented. Stay tuned!");
}
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "iox2-rpc"
description = "Iceoryx2: CLI for rpc operations"
categories = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-rpc/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2024 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache Software License 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
// which is available at https://opensource.org/licenses/MIT.
//
// SPDX-License-Identifier: Apache-2.0 OR MIT

fn main() {
println!("Not implemented. Stay tuned!");
}
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-services/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "iox2-services"
description = "Iceoryx2: CLI for managing iceoryx2 services"
categories = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-services/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2024 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache Software License 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
// which is available at https://opensource.org/licenses/MIT.
//
// SPDX-License-Identifier: Apache-2.0 OR MIT

fn main() {
println!("Not implemented. Stay tuned!");
}
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-sub/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "iox2-sub"
description = "Iceoryx2: CLI for subscribing to iceoryx2"
categories = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
15 changes: 15 additions & 0 deletions iceoryx2-cli/iox2-sub/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2024 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache Software License 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
// which is available at https://opensource.org/licenses/MIT.
//
// SPDX-License-Identifier: Apache-2.0 OR MIT

fn main() {
println!("Not implemented. Stay tuned!");
}
18 changes: 18 additions & 0 deletions iceoryx2-cli/iox2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "iox2"
description = "Iceoryx2: CLI entry-point"
categories = { workspace = true }
edition = { workspace = true }
homepage = { workspace = true }
keywords = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }

[dependencies]
human-panic = { workspace = true }
better-panic = { workspace = true }
clap = { workspace = true }
colored = { workspace = true }
thiserror = { workspace = true }
59 changes: 59 additions & 0 deletions iceoryx2-cli/iox2/src/cli.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Copyright (c) 2024 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
//
// This program and the accompanying materials are made available under the
// terms of the Apache Software License 2.0 which is available at
// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
// which is available at https://opensource.org/licenses/MIT.
//
// SPDX-License-Identifier: Apache-2.0 OR MIT

use clap::Parser;
use colored::*;

#[derive(Parser, Debug)]
#[command(
name = "iox2",
about = "The command-line interface to iceoryx2",
long_about = None,
version = env!("CARGO_PKG_VERSION"),
disable_help_subcommand = true,
arg_required_else_help = true,
help_template = help_template(),
)]
pub struct Cli {
#[arg(short, long, help = "List all installed commands")]
pub list: bool,

#[arg(
short,
long,
help = "Display paths that will be checked for installed commands"
)]
pub paths: bool,

#[arg(
short,
long,
help = "Specify to execute development versions of commands if they exist"
)]
pub dev: bool,

#[arg(hide = true, required = false)]
pub external_command: Vec<String>,
}

fn help_template() -> String {
format!(
"{}{}{}\n\n{}\n{{options}}\n\n{}\n{{subcommands}}{}{}",
"Usage: ".bright_green().bold(),
"iox2 ".bold(),
"[OPTIONS] [COMMAND]",
"Options:".bright_green().bold(),
"Commands:".bright_green().bold(),
" ... ".bold(),
"See all installed commands with --list"
)
}
Loading

0 comments on commit 077fb9f

Please sign in to comment.