|
|
|
|
@ -152,6 +152,11 @@ fn app() -> clap::Command<'static> {
|
|
|
|
|
.default_value("on")
|
|
|
|
|
.help("Enable or disable syntax highlighting.")
|
|
|
|
|
)
|
|
|
|
|
.arg(
|
|
|
|
|
Arg::new("exit-code").long("exit-code")
|
|
|
|
|
.env("DFT_EXIT_CODE")
|
|
|
|
|
.help("Set the exit code to 1 if there are syntactic changes in any text files, or byte changes in any binary files.")
|
|
|
|
|
)
|
|
|
|
|
.arg(
|
|
|
|
|
Arg::new("skip-unchanged").long("skip-unchanged")
|
|
|
|
|
.help("Don't display anything if a file is unchanged.")
|
|
|
|
|
@ -259,6 +264,7 @@ pub enum Mode {
|
|
|
|
|
byte_limit: usize,
|
|
|
|
|
display_options: DisplayOptions,
|
|
|
|
|
missing_as_empty: bool,
|
|
|
|
|
set_exit_code: bool,
|
|
|
|
|
language_override: Option<guess_language::Language>,
|
|
|
|
|
/// The path where we can read the LHS file. This is often a
|
|
|
|
|
/// temporary file generated by source control.
|
|
|
|
|
@ -451,6 +457,8 @@ pub fn parse_args() -> Mode {
|
|
|
|
|
// file on all platforms?
|
|
|
|
|
let missing_as_empty = matches.is_present("missing-as-empty");
|
|
|
|
|
|
|
|
|
|
let set_exit_code = matches.is_present("exit-code");
|
|
|
|
|
|
|
|
|
|
let display_options = DisplayOptions {
|
|
|
|
|
background_color,
|
|
|
|
|
use_color,
|
|
|
|
|
@ -468,6 +476,7 @@ pub fn parse_args() -> Mode {
|
|
|
|
|
byte_limit,
|
|
|
|
|
display_options,
|
|
|
|
|
missing_as_empty,
|
|
|
|
|
set_exit_code,
|
|
|
|
|
language_override,
|
|
|
|
|
lhs_path,
|
|
|
|
|
rhs_path,
|
|
|
|
|
|