()
| 17 | use readers::{CachedReader, FileReader}; |
| 18 | |
| 19 | fn main() { |
| 20 | env_logger::init(); |
| 21 | |
| 22 | let formats = formats::load_formats(); |
| 23 | let format_ids: Vec<&str> = formats.iter().map(|(&k, _)| k).collect(); |
| 24 | |
| 25 | let mut args = Command::new("each") |
| 26 | .version("0.2") |
| 27 | .author("Arpad Ray <hello@arpad.pizza>") |
| 28 | .about("Build and execute command lines from structured input") |
| 29 | .trailing_var_arg(true) |
| 30 | .arg( |
| 31 | Arg::new("input") |
| 32 | .short('i') |
| 33 | .long("input") |
| 34 | .value_name("FILE") |
| 35 | .multiple_occurrences(true) |
| 36 | .help("Read input from FILE instead of stdin") |
| 37 | .takes_value(true), |
| 38 | ) |
| 39 | .arg( |
| 40 | Arg::new("format") |
| 41 | .short('f') |
| 42 | .long("format") |
| 43 | .value_name("FORMAT") |
| 44 | .help("Input file format") |
| 45 | .takes_value(true) |
| 46 | .possible_values(format_ids.as_slice()), |
| 47 | ) |
| 48 | .arg( |
| 49 | Arg::new("query") |
| 50 | .short('q') |
| 51 | .long("query") |
| 52 | .value_name("QUERY") |
| 53 | .help("JMES query to apply to each input file") |
| 54 | .takes_value(true), |
| 55 | ) |
| 56 | .arg( |
| 57 | Arg::new("output-format") |
| 58 | .short('F') |
| 59 | .long("output-format") |
| 60 | .value_name("FORMAT") |
| 61 | .help("Output file format") |
| 62 | .takes_value(true) |
| 63 | .possible_values(format_ids.as_slice()), |
| 64 | ) |
| 65 | .arg( |
| 66 | Arg::new("prompt") |
| 67 | .short('p') |
| 68 | .long("interactive") |
| 69 | .help("Prompt for each value"), |
| 70 | ) |
| 71 | .arg( |
| 72 | Arg::new("max-procs") |
| 73 | .short('P') |
| 74 | .long("max-procs") |
| 75 | .value_name("max-procs") |
| 76 | .help("Run up to max-procs processes at a time") |
nothing calls this directly
no test coverage detected
searching dependent graphs…