Skip to content

Commit 838734c

Browse files
committed
Make -u option take no effect and hide from users.
1 parent ae09863 commit 838734c

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

src/options.rs

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ fn app() -> clap::Command<'static> {
134134
.required(false),
135135
)
136136
.arg(
137-
Arg::new("unified_default")
137+
// Dummy 'unified' flag of POSIX/GNU diff utility for svn support:
138+
// This takes no effect.
139+
Arg::new("nop_unified")
138140
.short('u')
139-
.conflicts_with("display")
140-
.help("Use inline style for display mode.")
141+
.hide(true)
141142
)
142143
.arg(
143144
Arg::new("label").short('L')
@@ -555,24 +556,20 @@ pub fn parse_args() -> Mode {
555556
detect_display_width()
556557
};
557558

558-
let display_mode = if matches.is_present("unified_default") {
559-
DisplayMode::Inline
560-
} else {
561-
match matches.value_of("display").expect("display has a default") {
562-
"side-by-side" => DisplayMode::SideBySide,
563-
"side-by-side-show-both" => DisplayMode::SideBySideShowBoth,
564-
"inline" => DisplayMode::Inline,
565-
"json" => {
566-
if env::var(format!("DFT_UNSTABLE")).is_err() {
567-
eprintln!("JSON output is an unstable feature and its format may change in future. To enable JSON output, set the environment variable DFT_UNSTABLE=yes.");
568-
std::process::exit(EXIT_BAD_ARGUMENTS);
569-
}
570-
571-
DisplayMode::Json
572-
}
573-
_ => {
574-
unreachable!("clap has already validated display")
559+
let display_mode = match matches.value_of("display").expect("display has a default") {
560+
"side-by-side" => DisplayMode::SideBySide,
561+
"side-by-side-show-both" => DisplayMode::SideBySideShowBoth,
562+
"inline" => DisplayMode::Inline,
563+
"json" => {
564+
if env::var(format!("DFT_UNSTABLE")).is_err() {
565+
eprintln!("JSON output is an unstable feature and its format may change in future. To enable JSON output, set the environment variable DFT_UNSTABLE=yes.");
566+
std::process::exit(EXIT_BAD_ARGUMENTS);
575567
}
568+
569+
DisplayMode::Json
570+
}
571+
_ => {
572+
unreachable!("clap has already validated display")
576573
}
577574
};
578575

0 commit comments

Comments
 (0)