usage: added env section

master
Avril 4 years ago
parent 5482ee6d82
commit 811ffc3ed7
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -158,6 +158,7 @@ impl fmt::Display for Opt
opt!("--unlimit", "-U"; * 3 "No limit to number of processes spawned at once"),
opt!("--completion", "-c" => "action"; "Set the default action on completion", ["ACTIONS", "COMPLETION"], "ignore"),
opt!("--silent", "-s"; * 3 "Output no messages other than that of child processes"),
opt!("--stfu", "-S"; * 3 "Output no messages at all"),
opt!("\nChild I/O"),
opt!(where "Defaults for I/O redirections of children\nThese can be overwritten individually with explicit inputs."),
@ -198,13 +199,14 @@ impl fmt::Display for Opt
]
}
/// The `process completion` section.
#[inline] fn completion() -> impl Iterator<Item = Opt>
{
iter![
opt!(in "COMPLETION"),
opt!(where "Directives for how to handle abnormal process completion (i.e. non-zero exit codes)\nThis does not apply to `detached` processes", ["DETACHING"]),
opt!("ignore"; * 2 "Ignore process return code"),
opt!("ignore"; * 2 "Ignore process return code", ""),
opt!("supercede"; * 2 "If return code is a non-zero code, use it as the return code for the parent (this) process.\n\t\t\tIf there are multiple non-zero return codes, it is not specified which is returned"),
opt!("terminate"; * 2 "If return code is a non-zero code, abort all running children and return the code as this process' return code immediately"),
opt!("wait"; * 3 "Same as `terminate`, except waits for currently active processes to complete before aborting"),
@ -216,10 +218,31 @@ impl fmt::Display for Opt
]
}
/// Get the sections as display iterators
#[inline] fn environment() -> impl Iterator<Item = Opt>
{
iter![
opt!(in "ENVIRONMENT"),
opt!(where "Some environment variables can control the behaviour of the program also"),
opt!("RUST_LOG"),
opt!(where "Controls the logging level of the parent process\nThese can be surpressed entirely by `--silent` or `--stfu`\nIf the var is not set, the default level is used."),
opt!("trace"; * 2 "The most verbose logging"),
opt!("debug"; * 2 "Include debug messages"),
opt!("info"; * 2 "Include information messages"),
opt!("warn"; * 2 "Only warnings and errors"),
opt!("error"; * 2 "Only errors"),
opt!("none"; * 2 "No diagnostic messages", ""),
opt!()
]
}
/// Get the sections as display iterators.
/// Each item in the iterator is intended to be written as a single line.
pub fn sections() -> impl Iterator<Item = impl fmt::Display>
{
options()
.chain(actions())
.chain(completion())
.chain(environment())
}

Loading…
Cancel
Save