From 2f45ffdade8d2c4d0b35326e3600bc58fb3143b4 Mon Sep 17 00:00:00 2001 From: Avril Date: Fri, 25 Dec 2020 12:59:56 +0000 Subject: [PATCH] usage: start spec exec --- src/arg/usage.rs | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/src/arg/usage.rs b/src/arg/usage.rs index e5f8939..b91a5ff 100644 --- a/src/arg/usage.rs +++ b/src/arg/usage.rs @@ -165,7 +165,12 @@ impl fmt::Display for Opt opt!("Explicit tasks"), opt!(where "You can apply very specific rules to individually provided tasks.\nFull explanations are below", ["EXPLICITY"]), - //TODO + opt!("--execute-spec:", "-ex:"; * 2 "Explicit `--execute`"), + opt!("--shell-execute-spec:", "-esx:"; "Explicit `--execute`"), + opt!("--+execute-spec:", "-Ex:"; * 2 "Explicit `--+execute`"), + opt!("--+shell-execute-spec:", "-Esx:"; "Explicit `--+shell-execute`"), + opt!("--x:"; * 5 "Explicit `--`"), + opt!("--sx:"; * 5 "Explicit `--s`"), opt!() ] @@ -279,7 +284,34 @@ fn explicity() -> impl Iterator { iter![ opt!(in "EXPLICITY"), - opt!(where "Using the `-*x` family of arguments, the options for explicit dispatch are described here"), + opt!(where "Using the `-*x` / `--*-spec` family of arguments, the options for explicit dispatch are described here\nThe options are provided in the form `=:=...`. `value` can be optional depending on the option.\nThe opt-value pairs are described below. Some can be specified multiple times if said so."), + + opt!("Common"), + opt!(where "For all execution modes"), + + opt!("r" => "number"; "Repeat execution `number` times."), + opt!("r"; * 2 "Repeat indefinately."), + opt!(), + + opt!("c" => "action"; "Action when process completes with non-zero return code.", ["COMPLETION"]), + + opt!(), + opt!("uid" => "user id"; * 2 "Run as this uid (must be root to use this option)", ["ACTIONS, Control"]), + opt!("user" => "user name"; "Run as this user (must be root to use this option)", ["ACTIONS, Control"]), + opt!("gid" => "group id"; "Run as this gid (must be root to use this option)", ["ACTIONS, Control"]), + opt!("group" => "group name"; "Run as this group (must be root to use this option)", ["ACTIONS, Control"]), + + opt!(), + opt!("stdin" => "action"; "How to handle process' stdin stream", ["ACTIONS, I/O"]), + opt!("stdout" => "action"; "How to handle process' stdout stream", ["ACTIONS, I/O"]), + opt!("stderr" => "action"; "How to handle process' stderr stream", ["ACTIONS, I/O"]), + + opt!(), + opt!("Normal execute"), + opt!(where "For non-shell execution"), + + opt!("p" => "program"; "Specify the process name or path"), + opt!("a" => "args"; "Arguments for the process, comma seperated. Multiple of these options can be used to append arguments one by one"), opt!() ]