Skip to content

Commit 8f982e6

Browse files
committed
Tweak CLI config
1 parent 8759feb commit 8f982e6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#[cfg(test)] extern crate parameterized_test;
44

55
use std::convert::TryFrom;
6-
use clap::{Arg, App};
6+
use clap::{Arg, App, AppSettings};
77
use subprocess::{Exec, Redirection, ExitStatus, CaptureData, PopenConfig};
88
use std::ffi::OsStr;
99
use std::time::{Duration, Instant};
@@ -142,6 +142,8 @@ fn main() {
142142
let matches = App::new(crate_name!())
143143
.version(crate_version!())
144144
.about(crate_description!())
145+
.setting(AppSettings::ArgRequiredElseHelp) // https://github.com/clap-rs/clap/issues/1264
146+
.setting(AppSettings::DeriveDisplayOrder)
145147
.arg(Arg::with_name("uuid")
146148
.long("uuid")
147149
.short("k")
@@ -158,6 +160,7 @@ fn main() {
158160
.help("POST the first 10k bytes instead of the last"))
159161
.arg(Arg::with_name("ping_only")
160162
.long("ping_only")
163+
.conflicts_with_all(&["detailed", "env"])
161164
.help("Don't POST any output from the command"))
162165
.arg(Arg::with_name("detailed")
163166
.long("detailed")

0 commit comments

Comments
 (0)