summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRyan Geary <rtgnj42@gmail.com>2019-09-06 17:51:25 -0400
committerRyan Geary <rtgnj42@gmail.com>2019-09-06 17:51:25 -0400
commit055f38a9baff01bb4521ace639b520b75417faa5 (patch)
tree4dfcaca287c860f9e469f953a2ab073f6fbfb183 /src
parent97ef8647825c0667b87600e06b99a5d519d8edd0 (diff)
Add flag for input file, change inclusive short to n
Diffstat (limited to 'src')
-rw-r--r--src/main.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index 223021b..48f4f9e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -16,16 +16,12 @@ enum Choice {
#[derive(Debug, StructOpt)]
#[structopt(name = "choose", about = "`choose` sections from each line of files")]
struct Opt {
- /// Capture range of fields
- #[structopt(parse(try_from_str = parse_choice))]
- choice: Choice,
-
/// Specify field separator other than whitespace
#[structopt(short, long)]
field_separator: Option<String>,
/// Use inclusive ranges
- #[structopt(short, long)]
+ #[structopt(short = "n", long)]
inclusive: bool,
/// Activate debug mode
@@ -33,8 +29,12 @@ struct Opt {
debug: bool,
/// Input file
- #[structopt(parse(from_os_str))]
+ #[structopt(short, long, parse(from_os_str))]
input: Option<PathBuf>,
+
+ /// Fields to print
+ #[structopt(required = true, min_values = 1, parse(try_from_str = parse_choice))]
+ choice: Vec<Choice>,
}
fn main() {