parent
55ac062da0
commit
1869888b1a
@ -130,11 +130,6 @@ fn make_opts() -> Options {
|
||||
"Format specified line ranges. See README for more detail on the JSON format.",
|
||||
"JSON",
|
||||
);
|
||||
opts.optflag(
|
||||
"",
|
||||
"verbose-diff",
|
||||
"Emit a more verbose diff, indicating the end of lines.",
|
||||
);
|
||||
opts.optflag("h", "help", "Show this message");
|
||||
opts.optflag("", "skip-children", "Don't reformat child modules");
|
||||
opts.optflag(
|
||||
|
@ -144,7 +144,6 @@
|
||||
|
||||
// Not user-facing
|
||||
verbose: Verbosity, Verbosity::Normal, false, "How much to information to emit to the user";
|
||||
verbose_diff: bool, false, false, "Emit verbose diffs";
|
||||
file_lines: FileLines, FileLines::all(), false,
|
||||
"Lines to format; this is not supported in rustfmt.toml, and can only be specified \
|
||||
via the --file-lines option";
|
||||
|
@ -330,7 +330,6 @@ pub struct CliOptions {
|
||||
skip_children: Option<bool>,
|
||||
quiet: bool,
|
||||
verbose: bool,
|
||||
verbose_diff: bool,
|
||||
pub(super) config_path: Option<PathBuf>,
|
||||
write_mode: Option<WriteMode>,
|
||||
color: Option<Color>,
|
||||
@ -347,7 +346,6 @@ pub fn from_matches(matches: &Matches) -> FmtResult<CliOptions> {
|
||||
if options.verbose && options.quiet {
|
||||
return Err(format_err!("Can't use both `--verbose` and `--quiet`"));
|
||||
}
|
||||
options.verbose_diff = matches.opt_present("verbose-diff");
|
||||
|
||||
let unstable_features = matches.opt_present("unstable-features");
|
||||
let rust_nightly = option_env!("CFG_RELEASE_CHANNEL")
|
||||
@ -404,7 +402,6 @@ pub fn apply_to(self, config: &mut Config) {
|
||||
} else {
|
||||
config.set().verbose(Verbosity::Normal);
|
||||
}
|
||||
config.set().verbose_diff(self.verbose_diff);
|
||||
config.set().file_lines(self.file_lines);
|
||||
config.set().unstable_features(self.unstable_features);
|
||||
if let Some(skip_children) = self.skip_children {
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use config::{Color, Config};
|
||||
use config::{Color, Config, Verbosity};
|
||||
use diff;
|
||||
use std::collections::VecDeque;
|
||||
use std::io;
|
||||
@ -154,7 +154,11 @@ pub fn print_diff<F>(diff: Vec<Mismatch>, get_section_title: F, config: &Config)
|
||||
F: Fn(u32) -> String,
|
||||
{
|
||||
let color = config.color();
|
||||
let line_terminator = if config.verbose_diff() { "⏎" } else { "" };
|
||||
let line_terminator = if config.verbose() == Verbosity::Verbose {
|
||||
"⏎"
|
||||
} else {
|
||||
""
|
||||
};
|
||||
|
||||
let mut writer = OutputWriter::new(color);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user