|
|
@ -8,7 +8,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|
|
|
AppSettings::ColorNever
|
|
|
|
AppSettings::ColorNever
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let app = ClapApp::new(crate_name!())
|
|
|
|
let mut app = ClapApp::new(crate_name!())
|
|
|
|
.version(crate_version!())
|
|
|
|
.version(crate_version!())
|
|
|
|
.global_setting(clap_color_setting)
|
|
|
|
.global_setting(clap_color_setting)
|
|
|
|
.global_setting(AppSettings::DeriveDisplayOrder)
|
|
|
|
.global_setting(AppSettings::DeriveDisplayOrder)
|
|
|
@ -44,7 +44,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|
|
|
.long_help(
|
|
|
|
.long_help(
|
|
|
|
"Show non-printable characters like space, tab or newline. \
|
|
|
|
"Show non-printable characters like space, tab or newline. \
|
|
|
|
This option can also be used to print binary files. \
|
|
|
|
This option can also be used to print binary files. \
|
|
|
|
Use '--tabs' to control the width of the tab-placeholders."
|
|
|
|
Use '--tabs' to control the width of the tab-placeholders.",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.arg(
|
|
|
|
.arg(
|
|
|
@ -90,7 +90,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|
|
|
'--highlight-line 40' highlights line 40\n \
|
|
|
|
'--highlight-line 40' highlights line 40\n \
|
|
|
|
'--highlight-line 30:40' highlights lines 30 to 40\n \
|
|
|
|
'--highlight-line 30:40' highlights lines 30 to 40\n \
|
|
|
|
'--highlight-line :40' highlights lines 1 to 40\n \
|
|
|
|
'--highlight-line :40' highlights lines 1 to 40\n \
|
|
|
|
'--highlight-line 40:' highlights lines 40 to the end of the file"
|
|
|
|
'--highlight-line 40:' highlights lines 40 to the end of the file",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.arg(
|
|
|
|
.arg(
|
|
|
@ -101,10 +101,16 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|
|
|
.multiple(true)
|
|
|
|
.multiple(true)
|
|
|
|
.value_name("name")
|
|
|
|
.value_name("name")
|
|
|
|
.help("Specify the name to display for a file.")
|
|
|
|
.help("Specify the name to display for a file.")
|
|
|
|
.long_help("Specify the name to display for a file. Useful when piping \
|
|
|
|
.long_help(
|
|
|
|
|
|
|
|
"Specify the name to display for a file. Useful when piping \
|
|
|
|
data to bat from STDIN when bat does not otherwise know \
|
|
|
|
data to bat from STDIN when bat does not otherwise know \
|
|
|
|
the filename."),
|
|
|
|
the filename.",
|
|
|
|
)
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[cfg(feature = "git")]
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
app = app
|
|
|
|
.arg(
|
|
|
|
.arg(
|
|
|
|
Arg::with_name("diff")
|
|
|
|
Arg::with_name("diff")
|
|
|
|
.long("diff")
|
|
|
|
.long("diff")
|
|
|
@ -134,7 +140,9 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|
|
|
"Include N lines of context around added/removed/modified lines when using '--diff'.",
|
|
|
|
"Include N lines of context around added/removed/modified lines when using '--diff'.",
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
.arg(
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app = app.arg(
|
|
|
|
Arg::with_name("tabs")
|
|
|
|
Arg::with_name("tabs")
|
|
|
|
.long("tabs")
|
|
|
|
.long("tabs")
|
|
|
|
.overrides_with("tabs")
|
|
|
|
.overrides_with("tabs")
|
|
|
@ -334,7 +342,9 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
|
|
|
|
.validator(|val| {
|
|
|
|
.validator(|val| {
|
|
|
|
let mut invalid_vals = val.split(',').filter(|style| {
|
|
|
|
let mut invalid_vals = val.split(',').filter(|style| {
|
|
|
|
!&[
|
|
|
|
!&[
|
|
|
|
"auto", "full", "plain", "changes", "header", "grid", "numbers", "snip"
|
|
|
|
"auto", "full", "plain", "header", "grid", "numbers", "snip",
|
|
|
|
|
|
|
|
#[cfg(feature = "git")]
|
|
|
|
|
|
|
|
"changes",
|
|
|
|
]
|
|
|
|
]
|
|
|
|
.contains(style)
|
|
|
|
.contains(style)
|
|
|
|
});
|
|
|
|
});
|
|
|
|