From efbc3fb2131b8c69a88e0622ad4b120c2c48ed85 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 21 Apr 2020 15:04:53 +0200 Subject: add predicate documentation to the help text Sadly, structopt always displays this, despite the documentation stating that it should be hidden when the user uses -h (instead of --help). It seems like this is a bug in clap, which might get fixed with clap 3.0. --- src/main.rs | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index b6633ac..ab66848 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,10 +34,29 @@ macro_rules! unwrap { }; } -/// A program that allows you to search through all your evtc logs for specific -/// people. +/// A program that allows you to search through all your evtc logs for specific people. +/// +/// raidgrep supports different predicates that determine whether a log is included or not. +/// Predicates start with a - and optionally take an argument. Predicates can be combined with +/// "and", "or" and "not", and predicates that operate on single players (instead of logs) have to +/// be within an "all(player: ...)" or "any(player: ...)" construct. +/// +/// PREDICATES: +/// +/// -character REGEX True if the character name matches the regex. +/// -account REGEX True if the account name matches the regex. +/// -name REGEX True if either character or account name match. +/// +/// -success Only include successful logs. +/// -wipe Only include failed logs. +/// -outcome OUTCOMES Only include logs with the given outcomes. +/// -weekday WEEKDAYS Only include logs from the given weekdays. +/// -before DATE Only include logs from before the given date. +/// -after DATE Only include logs from after the given date. +/// -boss BOSSES Only include logs from the given bosses. +/// -player REGEX Shorthand to check if any player in the log has the given name. #[derive(StructOpt, Debug)] -#[structopt(name = "raidgrep")] +#[structopt(verbatim_doc_comment)] pub struct Opt { /// Path to the folder with logs. #[structopt(short = "d", long = "dir", default_value = ".", parse(from_os_str))] @@ -56,14 +75,20 @@ pub struct Opt { debug: bool, /// Load guild information from the API. + /// + /// Loading guild information requires network access and slows down the program considerably, + /// so this is disabled by default. #[structopt(long = "guilds")] guilds: bool, /// Run the REPL. + /// + /// The REPL will allow you to keep entering queries which are being searched by raidgrep, + /// until you manually exit with Crtl+C. #[structopt(long)] repl: bool, - /// The filter expression. + /// The filter expression, see PREDICATES for more information. expression: Vec, } -- cgit v1.2.3