summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-12-08 10:55:58 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-12-08 10:55:58 +0100
commitbbebc19ce4e33430884f12d3e04b66abf3183dfe (patch)
tree42dce4941c8786de6d047cd1ba27c1125e7af6e0 /src
parente65dcc4cab8211b0cc06218e3482c340cb673d0b (diff)
Enhance find-pkg subcommand to take more flags for printing package information
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs67
-rw-r--r--src/commands/find_pkg.rs12
2 files changed, 77 insertions, 2 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 780685d..48dd97b 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -390,10 +390,75 @@ pub fn cli<'a>() -> App<'a> {
.arg(Arg::new("terse")
.required(false)
.multiple(false)
- .short('t')
.long("terse")
+ .short('t')
.about("Do not use the fancy format, but simply <name> <version>")
)
+
+ .arg(Arg::new("show_sources")
+ .required(false)
+ .multiple(false)
+ .long("source")
+ .alias("sources")
+ .short('S')
+ .about("Show the sources of the package")
+ )
+
+ .arg(Arg::new("show_dependencies")
+ .required(false)
+ .multiple(false)
+ .long("dependencies")
+ .alias("deps")
+ .short('D')
+ .about("Show the dependencies of the package")
+ )
+
+ .arg(Arg::new("show_patches")
+ .required(false)
+ .multiple(false)
+ .long("patches")
+ .short('p')
+ .about("Show the patches of the package")
+ )
+
+ .arg(Arg::new("show_env")
+ .required(false)
+ .multiple(false)
+ .long("env")
+ .short('E')
+ .about("Show the environment of the package")
+ )
+
+ .arg(Arg::new("show_flags")
+ .required(false)
+ .multiple(false)
+ .long("flags")
+ .short('F')
+ .about("Show the flags of the package")
+ )
+
+ .arg(Arg::new("show_deny_images")
+ .required(false)
+ .multiple(false)
+ .long("deny-images")
+ .about("Show the images on which the package is not allowed to be built")
+ )
+
+ .arg(Arg::new("show_phases")
+ .required(false)
+ .multiple(false)
+ .long("phases")
+ .short('P')
+ .about("Show the phases of the script of the package")
+ )
+
+ .arg(Arg::new("show_script")
+ .required(false)
+ .multiple(false)
+ .long("script")
+ .short('s')
+ .about("Show the script of the package")
+ )
)
.subcommand(App::new("source")
.about("Handle package sources")
diff --git a/src/commands/find_pkg.rs b/src/commands/find_pkg.rs
index 90cf6c1..b53ea6b 100644
--- a/src/commands/find_pkg.rs
+++ b/src/commands/find_pkg.rs
@@ -43,8 +43,18 @@ pub async fn find_pkg(matches: &ArgMatches, config: &Configuration, repo: Reposi
crate::ui::print_packages(&mut outlock,
format,
iter,
+ config,
true,
- true)
+ true,
+ matches.is_present("show_sources"),
+ matches.is_present("show_dependencies"),
+ matches.is_present("show_patches"),
+ matches.is_present("show_env"),
+ matches.is_present("show_flags"),
+ matches.is_present("show_deny_images"),
+ matches.is_present("show_phases"),
+ matches.is_present("show_script")
+ )
}
}