Skip to content

Commit

Permalink
[eclipse-iceoryx#432] Implement CLI iox2-config
Browse files Browse the repository at this point in the history
  • Loading branch information
brosier01 committed Oct 14, 2024
1 parent 2bcc183 commit 0935fe2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion iceoryx2-cli/iox2-config/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
//
// SPDX-License-Identifier: Apache-2.0 OR MIT


use clap::Parser;
use clap::Subcommand;

Expand Down
7 changes: 5 additions & 2 deletions iceoryx2-cli/iox2-config/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

use anyhow::Result;
use iceoryx2_bb_posix::system_configuration::*;
use enum_iterator::all;
use iceoryx2::config::Config;
use iceoryx2_bb_posix::system_configuration::*;
use std::fs::File;
use std::io::Write;
use std::path::Path;
Expand Down Expand Up @@ -118,7 +118,10 @@ pub fn generate() -> Result<()> {
let mut file = File::create(&default_file_path)?;
file.write_all(toml_string.as_bytes())?;

println!("Default configuration is generated at {}", default_file_path.display());
println!(
"Default configuration is generated at {}",
default_file_path.display()
);

Ok(())
}
7 changes: 2 additions & 5 deletions iceoryx2-cli/iox2-config/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

// Copyright (c) 2024 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
Expand Down Expand Up @@ -46,14 +45,12 @@ fn main() {
if let Some(action) = cli.action {
match action {
Action::Show => {
if let Err(e) = commands::show()
{
if let Err(e) = commands::show() {
eprintln!("Failed to show options: {}", e);
}
}
Action::Generate => {
if let Err(e) = commands::generate()
{
if let Err(e) = commands::generate() {
eprintln!("Failed to generate default configuration: {}", e);
}
}
Expand Down

0 comments on commit 0935fe2

Please sign in to comment.