summaryrefslogtreecommitdiffstats
path: root/src/opt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/opt.rs')
-rw-r--r--src/opt.rs24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/opt.rs b/src/opt.rs
index b64991d..0b9a83c 100644
--- a/src/opt.rs
+++ b/src/opt.rs
@@ -8,30 +8,34 @@ use crate::config::Config;
#[structopt(name = "choose", about = "`choose` sections from each line of files")]
#[structopt(setting = structopt::clap::AppSettings::AllowLeadingHyphen)]
pub struct Opt {
- /// Specify field separator other than whitespace, using Rust `regex` syntax
+ /// Choose fields by character number
#[structopt(short, long)]
- pub field_separator: Option<String>,
-
- /// Specify output field separator
- #[structopt(short, long, parse(from_str = Config::parse_output_field_separator))]
- pub output_field_separator: Option<String>,
+ pub character_wise: bool,
- /// Use non-greedy field separators
+ /// Activate debug mode
#[structopt(short, long)]
- pub non_greedy: bool,
+ pub debug: bool,
/// Use exclusive ranges, similar to array indexing in many programming languages
#[structopt(short = "x", long)]
pub exclusive: bool,
- /// Activate debug mode
+ /// Specify field separator other than whitespace, using Rust `regex` syntax
#[structopt(short, long)]
- pub debug: bool,
+ pub field_separator: Option<String>,
/// Input file
#[structopt(short, long, parse(from_os_str))]
pub input: Option<PathBuf>,
+ /// Use non-greedy field separators
+ #[structopt(short, long)]
+ pub non_greedy: bool,
+
+ /// Specify output field separator
+ #[structopt(short, long, parse(from_str = Config::parse_output_field_separator))]
+ pub output_field_separator: Option<String>,
+
/// Fields to print. Either x, x:, :y, or x:y, where x and y are integers, colons indicate a
/// range, and an empty field on either side of the colon continues to the beginning or end of
/// the line.