From 8d7281c96693e73529c4c2cb21d0bb09e002c49b Mon Sep 17 00:00:00 2001 From: Avril Date: Thu, 24 Dec 2020 16:53:43 +0000 Subject: [PATCH] non --- src/arg/mod.rs | 5 ++--- src/arg/usage.rs | 15 ++++++++------- src/ext.rs | 1 - src/main.rs | 2 -- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/arg/mod.rs b/src/arg/mod.rs index eb9b464..d344b87 100644 --- a/src/arg/mod.rs +++ b/src/arg/mod.rs @@ -27,13 +27,12 @@ Usage: {prog} --help {opts} "#, prog = prog_name(), - //OPTIONS = "OPTIONS".bright_blue().bold(), opts = usage::sections().map(|x| lazy_format!("{}", x)).join("\n").trim()); } -/// Print usage then exit +/// Print usage then exit with code 0 #[inline(always)] pub fn usage() -> ! { print_usage(); - std::process::exit(1) + std::process::exit(0) } diff --git a/src/arg/usage.rs b/src/arg/usage.rs index a4a9b46..b170597 100644 --- a/src/arg/usage.rs +++ b/src/arg/usage.rs @@ -206,13 +206,14 @@ impl fmt::Display for Opt 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!("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"), - opt!("log"; * 3 "Write the code to this process' `stderr` if non-zero"), - opt!("file" => "filename"; "If non-zero, write the code to a file if non-zero. If unable to write to the file, it is ignored"), - opt!("retry" => "number"; "If non-zero, restart the process up to `number` times.\n\t\t\tIf `number` if 'inf', retry indefinately (this can cause an infinite loop if program never completes with zero exit code)"), + opt!("ignore"; * 3 "Ignore process return code", ""), + opt!("supercede"; * 3 "If return code is a non-zero code, use it as the return code for the parent (this) process.\n\t\t\t\tIf there are multiple non-zero return codes, it is not specified which is returned"), + opt!("terminate"; * 3 "If return code is a non-zero code, abort all running children and return the code as this process' return code immediately"), + opt!("wait"; * 4 "Same as `terminate`, except waits for currently active processes to complete before aborting"), + opt!("log"; * 4 "Write the code to this process' `stderr` if non-zero"), + opt!("file" => "filename"; * 2 "If non-zero, append the code to a file if non-zero. If unable to write to the file, it is ignored"), + opt!("file:clobber" => "filename"; "If non-zero, (over)write the code to a file if non-zero. If unable to write to the file, it is ignored"), + opt!("retry" => "number"; * 2 "If non-zero, restart the process up to `number` times.\n\t\t\t\tIf `number` if `inf`, retry indefinately (this can cause an infinite loop if program never completes with zero exit code)"), opt!() ] diff --git a/src/ext.rs b/src/ext.rs index 21c7dcd..99c0279 100644 --- a/src/ext.rs +++ b/src/ext.rs @@ -1,4 +1,3 @@ -use super::*; use std::fmt; pub trait FlatJoinStrsExt: Sized diff --git a/src/main.rs b/src/main.rs index cdbf751..1353112 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,3 @@ -#![feature(min_const_generics)] - #![allow(dead_code)] #[macro_use] extern crate log;