Skip to content

Commit

Permalink
fix: re-enable cli query depenency commands
Browse files Browse the repository at this point in the history
  • Loading branch information
dejanb committed Sep 14, 2023
1 parent cf7932e commit e6b39b4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ serde_json = "1.0.56"
colored_json = "3.0.1"
clap = { version = "4.0.29", features = ["derive"] }
nats = "0.24.0"
exporter = { git = "https://github.com/trustification/trustification.git", branch="guac-version" }
exporter = { git = "https://github.com/trustification/trustification.git"}
env_logger = "0.10"
log = "0.4.14"
humantime = "2.1.0"
Expand Down
9 changes: 5 additions & 4 deletions cli/src/query/dependencies.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::query::QueryConfig;
use colored_json::ToColoredJson;
use guac::client::GuacClient;
use packageurl::PackageUrl;
use std::process::ExitCode;
use std::str::FromStr;

#[derive(clap::Args, Debug)]
#[command(
Expand All @@ -15,14 +17,13 @@ pub struct DependenciesCommand {

impl DependenciesCommand {
pub async fn run(self) -> anyhow::Result<ExitCode> {
/*
let guac = GuacClient::new(self.config.guac_url);
let deps = guac.is_dependency(&self.config.purl).await?;
let guac = GuacClient::new(&self.config.guac_url);
let purl = PackageUrl::from_str(&self.config.purl)?;
let deps = guac.semantic().dependents_of(&purl).await?;
let out =
serde_json::to_string(&deps)?.to_colored_json(crate::color_mode(self.config.color))?;
println!("{}", out);

*/
Ok(ExitCode::SUCCESS)
}
}
10 changes: 5 additions & 5 deletions cli/src/query/dependents.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::query::QueryConfig;
use colored_json::ToColoredJson;
use guac::client::GuacClient;
use packageurl::PackageUrl;
use std::process::ExitCode;
use std::str::FromStr;

#[derive(clap::Args, Debug)]
#[command(
Expand All @@ -15,14 +17,12 @@ pub struct DependentsCommand {

impl DependentsCommand {
pub async fn run(self) -> anyhow::Result<ExitCode> {
/*
let guac = GuacClient::new(self.config.guac_url);
let deps = guac.is_dependent(&self.config.purl).await?;
let guac = GuacClient::new(&self.config.guac_url);
let purl = PackageUrl::from_str(&self.config.purl)?;
let deps = guac.semantic().dependencies_of(&purl).await?;
let out =
serde_json::to_string(&deps)?.to_colored_json(crate::color_mode(self.config.color))?;
println!("{}", out);
*/
Ok(ExitCode::SUCCESS)
}
}
4 changes: 2 additions & 2 deletions cli/src/query/vulnerabilities.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::query::QueryConfig;
use colored_json::ToColoredJson;
use guac::client::GuacClient;
// use colored_json::ToColoredJson;
// use guac::client::GuacClient;
use std::process::ExitCode;

#[derive(clap::Args, Debug)]
Expand Down

0 comments on commit e6b39b4

Please sign in to comment.