diff options
author | Matthias Beyer <matthias.beyer@atos.net> | 2019-04-24 09:44:28 +0200 |
---|---|---|
committer | Matthias Beyer <matthias.beyer@atos.net> | 2019-04-24 09:58:49 +0200 |
commit | 95cc8da13b712ed52b37446fde173f547581c0e2 (patch) | |
tree | cd36f26d0df22319871e929e5d1122b255e968e2 | |
parent | 4f3aebf1d71e98a8c78495838e229ea3999a8db1 (diff) |
Add "compare" functionality in CLI
-rw-r--r-- | src/cli.rs | 31 |
1 files changed, 31 insertions, 0 deletions
@@ -90,6 +90,37 @@ pub fn build_cli<'a>() -> App<'a, 'a> { .required(true)) ) + + .subcommand(SubCommand::with_name("compare") + .about("Compare a list of packages to distro repositories") + .arg(Arg::with_name("compare-list") + .index(1) + .required(true) + .multiple(false) + .takes_value(true) + .value_name("FILE") + .help("Compare the data from this list to a list of distros out there. Supports JSON and CSV, based on file extension (.json / .csv)")) + .arg(Arg::with_name("compare-distros") + .index(2) + .required(true) + .multiple(true) + .takes_value(true) + .value_name("DIST") + .help("A list of repology distribution names to compare to")) + + .after_help(r#" + Compare a list of packages to all supplied repology distributions. + The list of packages shall have the following format: + + * CSV: + Header: name;version;comment + + * JSON: + { "name": "...", "version": "...", "comment": "..." } + + "#) + ) + .after_help(r#" repolocli can read data from stdin, if you want to postprocess repology.org data you already fetched from repology.org/api/v1 via curl (or some other method). |