summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cli.rs8
-rw-r--r--src/commands/dependencies_of.rs1
-rw-r--r--src/commands/find_pkg.rs1
-rw-r--r--src/commands/what_depends.rs1
-rw-r--r--src/ui.rs36
5 files changed, 31 insertions, 16 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 0d3b371..4684588 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -395,6 +395,14 @@ pub fn cli<'a>() -> App<'a> {
.about("Do not use the fancy format, but simply <name> <version>")
)
+ .arg(Arg::new("show_all")
+ .required(false)
+ .multiple(false)
+ .long("all")
+ .short('A')
+ .about("Same as: -SDpEFPs --deny-images (all flags enabled)")
+ )
+
.arg(Arg::new("show_sources")
.required(false)
.multiple(false)
diff --git a/src/commands/dependencies_of.rs b/src/commands/dependencies_of.rs
index 701e7f7..4a31c1d 100644
--- a/src/commands/dependencies_of.rs
+++ b/src/commands/dependencies_of.rs
@@ -31,6 +31,7 @@ pub async fn dependencies_of(matches: &ArgMatches, config: &Configuration, repo:
print_build_deps);
let flags = crate::ui::PackagePrintFlags {
+ print_all: false,
print_runtime_deps,
print_build_deps,
print_sources: false,
diff --git a/src/commands/find_pkg.rs b/src/commands/find_pkg.rs
index a6e302a..8a56303 100644
--- a/src/commands/find_pkg.rs
+++ b/src/commands/find_pkg.rs
@@ -40,6 +40,7 @@ pub async fn find_pkg(matches: &ArgMatches, config: &Configuration, repo: Reposi
Ok(())
} else {
let flags = crate::ui::PackagePrintFlags {
+ print_all : matches.is_present("show_all"),
print_runtime_deps : crate::commands::util::getbool(matches, "dependency_type", crate::cli::IDENT_DEPENDENCY_TYPE_RUNTIME),
print_build_deps : crate::commands::util::getbool(matches, "dependency_type", crate::cli::IDENT_DEPENDENCY_TYPE_BUILD),
print_sources : matches.is_present("show_sources"),
diff --git a/src/commands/what_depends.rs b/src/commands/what_depends.rs
index 1d3ed07..01b599b 100644
--- a/src/commands/what_depends.rs
+++ b/src/commands/what_depends.rs
@@ -36,6 +36,7 @@ pub async fn what_depends(matches: &ArgMatches, config: &Configuration, repo: Re
.collect::<Result<Vec<_>>>()?;
let flags = crate::ui::PackagePrintFlags {
+ print_all: false,
print_runtime_deps,
print_build_deps,
print_sources: false,
diff --git a/src/ui.rs b/src/ui.rs
index 1c82943..f8612c5 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -30,6 +30,7 @@ pub fn package_repo_cleanness_check(repo_path: &Path) -> Result<()> {
}
pub struct PackagePrintFlags {
+ pub print_all: bool,
pub print_runtime_deps: bool,
pub print_build_deps: bool,
pub print_sources: bool,
@@ -51,14 +52,16 @@ impl PackagePrintFlags {
// script_line_numbers is not included, because these only modify what to print and not whether
// to print.
fn print_any(&self) -> bool {
- self.print_sources
- || self.print_dependencies
- || self.print_patches
- || self.print_env
- || self.print_flags
- || self.print_deny_images
- || self.print_phases
- || self.print_script
+ self.print_all || {
+ self.print_sources
+ || self.print_dependencies
+ || self.print_patches
+ || self.print_env
+ || self.print_flags
+ || self.print_deny_images
+ || self.print_phases
+ || self.print_script
+ }
}
}
@@ -103,14 +106,15 @@ fn print_package(out: &mut dyn Write,
data.insert("print_any" , serde_json::Value::Bool(flags.print_any()));
data.insert("print_runtime_deps" , serde_json::Value::Bool(flags.print_runtime_deps));
data.insert("print_build_deps" , serde_json::Value::Bool(flags.print_build_deps));
- data.insert("print_sources" , serde_json::Value::Bool(flags.print_sources));
- data.insert("print_dependencies" , serde_json::Value::Bool(flags.print_dependencies));
- data.insert("print_patches" , serde_json::Value::Bool(flags.print_patches));
- data.insert("print_env" , serde_json::Value::Bool(flags.print_env));
- data.insert("print_flags" , serde_json::Value::Bool(flags.print_flags));
- data.insert("print_deny_images" , serde_json::Value::Bool(flags.print_deny_images));
- data.insert("print_phases" , serde_json::Value::Bool(flags.print_phases));
- data.insert("print_script" , serde_json::Value::Bool(flags.print_script));
+
+ data.insert("print_sources" , serde_json::Value::Bool(flags.print_all || flags.print_sources));
+ data.insert("print_dependencies" , serde_json::Value::Bool(flags.print_all || flags.print_dependencies));
+ data.insert("print_patches" , serde_json::Value::Bool(flags.print_all || flags.print_patches));
+ data.insert("print_env" , serde_json::Value::Bool(flags.print_all || flags.print_env));
+ data.insert("print_flags" , serde_json::Value::Bool(flags.print_all || flags.print_flags));
+ data.insert("print_deny_images" , serde_json::Value::Bool(flags.print_all || flags.print_deny_images));
+ data.insert("print_phases" , serde_json::Value::Bool(flags.print_all || flags.print_phases));
+ data.insert("print_script" , serde_json::Value::Bool(flags.print_all || flags.print_script));
hb.render("package", &data)