-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Jean-Louis Leysens <[email protected]>
- Loading branch information
1 parent
ab13dae
commit 6557e47
Showing
14 changed files
with
227 additions
and
149 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
extern crate log; | ||
|
||
mod cli; | ||
mod error; | ||
mod modules; | ||
mod register; | ||
mod utils; | ||
mod help_strings; | ||
|
||
use log::error; | ||
use register::register; | ||
use utils::logger::Log; | ||
use colored::*; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
match register().await { | ||
Ok(_) => (), | ||
Err(e) => Log::default().error(e), | ||
Err(e) => { | ||
error!("{} {}", "Error:".red(), e); | ||
std::process::exit(1); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
use agent_controller::modules::features::FeaturesModule; | ||
use clap::Args; | ||
use log::{debug, info}; | ||
|
||
use crate::error::Result; | ||
use crate::utils::logger::Log; | ||
use crate::utils::logger::pretty_stringify_obj; | ||
|
||
#[derive(Args)] | ||
pub struct FeaturesOptions {} | ||
|
||
pub async fn parse_features_args(agent: impl FeaturesModule, logger: Log) -> Result<()> { | ||
pub async fn parse_features_args(agent: impl FeaturesModule) -> Result<()> { | ||
agent.discover_features().await.map(|features| { | ||
if logger.debug { | ||
logger.log_pretty(features) | ||
} else { | ||
logger.log_list(features.results.keys().collect()); | ||
} | ||
debug!("{}", pretty_stringify_obj(&features)); | ||
features | ||
.results | ||
.keys() | ||
.collect::<Vec<_>>() | ||
.iter() | ||
.for_each(|x| { | ||
info!("{}", x); | ||
}); | ||
}) | ||
} |
Oops, something went wrong.