diff options
-rw-r--r-- | Cargo.lock | 182 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/cli.rs | 228 | ||||
-rw-r--r-- | src/config.rs | 2 | ||||
-rw-r--r-- | src/options/set.rs | 25 |
5 files changed, 292 insertions, 147 deletions
@@ -56,7 +56,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.17", "libc", "winapi", ] @@ -211,26 +211,25 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.8" +version = "4.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190814073e85d238f31ff738fcb0bf6910cedeb73376c87cd69291028966fd83" +checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5" dependencies = [ - "atty", "bitflags", "clap_derive", "clap_lex", - "indexmap", + "is-terminal", "once_cell", "strsim", "termcolor", - "textwrap", + "terminal_size 0.2.5", ] [[package]] name = "clap_derive" -version = "3.2.7" +version = "4.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759bf187376e1afa7b85b959e6a664a3e7a95203415dba952ad19139e798f902" +checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0" dependencies = [ "heck", "proc-macro-error", @@ -241,9 +240,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09" dependencies = [ "os_str_bytes", ] @@ -270,7 +269,7 @@ dependencies = [ "libc", "once_cell", "regex", - "terminal_size", + "terminal_size 0.1.15", "unicode-width", "winapi", ] @@ -427,6 +426,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" [[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] name = "error-chain" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -688,6 +708,12 @@ dependencies = [ ] [[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + +[[package]] name = "idna" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -709,6 +735,28 @@ dependencies = [ ] [[package]] +name = "io-lifetimes" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "is-terminal" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b6b32576413a8e69b90e952e4a026476040d81017b80445deda5f2d3921857" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys", +] + +[[package]] name = "itertools" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -740,9 +788,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" [[package]] name = "libgit2-sys" @@ -784,6 +832,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" [[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] name = "log" version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1055,11 +1109,11 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1179,6 +1233,20 @@ dependencies = [ ] [[package]] +name = "rustix" +version = "0.36.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] name = "ryu" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1355,10 +1423,14 @@ dependencies = [ ] [[package]] -name = "textwrap" -version = "0.15.0" +name = "terminal_size" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "4c9afddd2cec1c0909f06b00ef33f94ab2cc0578c4a610aa208ddfec8aa2b43a" +dependencies = [ + "rustix", + "windows-sys", +] [[package]] name = "thiserror" @@ -1447,6 +1519,12 @@ dependencies = [ ] [[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] name = "unicode-normalization" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1579,6 +1657,72 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" + +[[package]] name = "xdg" version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -24,7 +24,7 @@ atty = "0.2.14" bitflags = "1.3.2" box_drawing = "0.1.2" bytelines = "2.4.0" -clap = { version = "3.2.8", features = ["derive"] } +clap = { version = "4.1.8", features = ["derive", "help", "usage", "error-context", "wrap_help"] } console = "0.15.0" ctrlc = "3.2.2" dirs-next = "2.0.0" @@ -3,7 +3,7 @@ use std::ffi::OsString; use std::path::PathBuf; use bat::assets::HighlightingAssets; -use clap::{AppSettings, ColorChoice, CommandFactory, FromArgMatches, Parser}; +use clap::{ColorChoice, CommandFactory, FromArgMatches, Parser}; use lazy_static::lazy_static; use syntect::highlighting::Theme as SyntaxTheme; use syntect::parsing::SyntaxSet; @@ -16,12 +16,11 @@ use crate::utils; use crate::utils::bat::output::PagingMode; #[derive(Parser)] -#[clap( +#[command( name = "delta", about = "A viewer for git and diff output", version, color = ColorChoice::Always, - setting(AppSettings::DeriveDisplayOrder), term_width(0), after_long_help = "\ GIT CONFIG @@ -208,7 +207,7 @@ For a short help summary, please use delta -h. " )] pub struct Opt { - #[clap(long = "blame-code-style", value_name = "STYLE")] + #[arg(long = "blame-code-style", value_name = "STYLE")] /// Style string for the code section of a git blame line. /// /// By default the code will be syntax-highlighted with the same background color as the blame @@ -216,7 +215,7 @@ pub struct Opt { /// setting this option to 'syntax' will syntax-highlight the code with no background color. pub blame_code_style: Option<String>, - #[clap( + #[arg( long = "blame-format", default_value = "{timestamp:<15} {author:<15.14} {commit:<8}", value_name = "FMT" @@ -226,14 +225,14 @@ pub struct Opt { /// Available placeholders are "{timestamp}", "{author}", and "{commit}". pub blame_format: String, - #[clap(long = "blame-palette", value_name = "COLORS")] + #[arg(long = "blame-palette", value_name = "COLORS")] /// Background colors used for git blame lines (space-separated string). /// /// Lines added by the same commit are painted with the same color; colors are recycled as /// needed. pub blame_palette: Option<String>, - #[clap( + #[arg( long = "blame-separator-format", default_value = "│{n:^4}│", value_name = "FMT" @@ -248,11 +247,11 @@ pub struct Opt { /// N-th (modulo) line. pub blame_separator_format: String, - #[clap(long = "blame-separator-style", value_name = "STYLE")] + #[arg(long = "blame-separator-style", value_name = "STYLE")] /// Style string for the blame-separator-format. pub blame_separator_style: Option<String>, - #[clap( + #[arg( long = "blame-timestamp-format", default_value = "%Y-%m-%d %H:%M:%S %z", value_name = "FMT" @@ -260,7 +259,7 @@ pub struct Opt { /// Format of `git blame` timestamp in raw git output received by delta. pub blame_timestamp_format: String, - #[clap(long = "blame-timestamp-output-format", value_name = "FMT")] + #[arg(long = "blame-timestamp-output-format", value_name = "FMT")] /// Format string for git blame timestamp output. /// /// This string is used for formatting the timestamps in git blame output. It must follow @@ -270,14 +269,14 @@ pub struct Opt { /// See: (https://docs.rs/chrono/latest/chrono/format/strftime/index.html) pub blame_timestamp_output_format: Option<String>, - #[clap(long = "color-only")] + #[arg(long = "color-only")] /// Do not alter the input structurally in any way. /// /// But color and highlight hunk lines according to your delta configuration. This is mainly /// intended for other tools that use delta. pub color_only: bool, - #[clap( + #[arg( long = "commit-decoration-style", default_value = "", value_name = "STYLE" @@ -288,7 +287,7 @@ pub struct Opt { /// 'ul' (underline), 'ol' (overline), or the combination 'ul ol'. pub commit_decoration_style: String, - #[clap( + #[arg( long = "commit-regex", default_value = r"^commit ", value_name = "REGEX" @@ -296,45 +295,45 @@ pub struct Opt { /// Regular expression used to identify the commit line when parsing git output. pub commit_regex: String, - #[clap(long = "commit-style", default_value = "raw", value_name = "STYLE")] + #[arg(long = "commit-style", default_value = "raw", value_name = "STYLE")] /// Style string for the commit hash line. /// /// See STYLES section. The style 'omit' can be used to remove the commit hash line from the /// output. pub commit_style: String, - #[clap(long = "dark")] + #[arg(long = "dark")] /// Use default colors appropriate for a dark terminal background. /// /// For more control, see the style options and --syntax-theme. pub dark: bool, - #[clap(long = "default-language", value_name = "LANG")] + #[arg(long = "default-language", value_name = "LANG")] /// Default language used for syntax highlighting. /// /// Used when the language cannot be inferred from a filename. It will typically make sense to /// set this in per-repository git config (.git/config) pub default_language: Option<String>, - #[clap(long = "diff-highlight")] + #[arg(long = "diff-highlight")] /// Emulate diff-highlight. /// /// (https://github.com/git/git/tree/master/contrib/diff-highlight) pub diff_highlight: bool, - #[clap(long = "diff-so-fancy")] + #[arg(long = "diff-so-fancy")] /// Emulate diff-so-fancy. /// /// (https://github.com/so-fancy/diff-so-fancy) pub diff_so_fancy: bool, - #[clap(long = "diff-stat-align-width", default_value = "48", value_name = "N")] + #[arg(long = "diff-stat-align-width", default_value = "48", value_name = "N")] /// Width allocated for file paths in a diff stat section. /// /// If a relativized file path exceeds this width then the diff stat will be misaligned. pub diff_stat_align_width: usize, - #[clap(long = "features", value_name = "FEATURES")] + #[arg(long = "features", value_name = "FEATURES")] /// Names of delta features to activate (space-separated). /// /// A feature is a named collection of delta options in ~/.gitconfig. See FEATURES section. The @@ -344,7 +343,7 @@ pub struct Opt { /// side-by-side temporarily (use DELTA_FEATURES=+ to go back to just the features from git config). pub features: Option<String>, - #[clap( + #[arg( long = "file-added-label", default_value = "added:", value_name = "STRING" @@ -354,7 +353,7 @@ pub struct Opt { /// Used in the default value of navigate-regex. pub file_added_label: String, - #[clap( + #[arg( long = "file-copied-label", default_value = "copied:", value_name = "STRING" @@ -362,7 +361,7 @@ pub struct Opt { /// Text to display before a copied file path. pub file_copied_label: String, - #[clap( + #[arg( long = "file-decoration-style", default_value = "blue ul", value_name = "STYLE" @@ -373,7 +372,7 @@ pub struct Opt { /// 'ul' (underline), 'ol' (overline), or the combination 'ul ol'. pub file_decoration_style: String, - #[clap( + #[arg( long = "file-modified-label", default_value = "", value_name = "STRING" @@ -383,7 +382,7 @@ pub struct Opt { /// Used in the default value of navigate-regex. pub file_modified_label: String, - #[clap( + #[arg( long = "file-removed-label", default_value = "removed:", value_name = "STRING" @@ -393,7 +392,7 @@ pub struct Opt { /// Used in the default value of navigate-regex. pub file_removed_label: String, - #[clap( + #[arg( long = "file-renamed-label", default_value = "renamed:", value_name = "STRING" @@ -403,47 +402,47 @@ pub struct Opt { /// Used in the default value of navigate-regex. pub file_renamed_label: String, - #[clap(long = "file-style", default_value = "blue", value_name = "STYLE")] + #[arg(long = "file-style", default_value = "blue", value_name = "STYLE")] /// Style string for the file section. /// /// See STYLES section. The style 'omit' can be used to remove the file section from the output. pub file_style: String, - #[structopt(long = "file-transformation", value_name = "SED_CMD")] + #[arg(long = "file-transformation", value_name = "SED_CMD")] /// Sed-style command transforming file paths for display. pub file_regex_replacement: Option<String>, - #[clap(long = "grep-context-line-style", value_name = "STYLE")] + #[arg(long = "grep-context-line-style", value_name = "STYLE")] /// Style string for non-matching lines of grep output. /// /// See STYLES section. Defaults to zero-style. pub grep_context_line_style: Option<String>, - #[clap(long = "grep-file-style", value_name = "STYLE")] + #[arg(long = "grep-file-style", value_name = "STYLE")] /// Style string for file paths in grep output. /// /// See STYLES section. Defaults to hunk-header-file-path-style. pub grep_file_style: Option<String>, - #[clap(long = "grep-line-number-style", value_name = "STYLE")] + #[arg(long = "grep-line-number-style", value_name = "STYLE")] /// Style string for line numbers in grep output. /// /// See STYLES section. Defaults to hunk-header-line-number-style. pub grep_line_number_style: Option<String>, - #[clap(long = "grep-match-line-style", value_name = "STYLE")] + #[arg(long = "grep-match-line-style", value_name = "STYLE")] /// Style string for matching lines of grep output. /// /// See STYLES section. Defaults to plus-style. pub grep_match_line_style: Option<String>, - #[clap(long = "grep-match-word-style", value_name = "STYLE")] + #[arg(long = "grep-match-word-style", value_name = "STYLE")] /// Style string for the matching substrings within a matching line of grep output. /// /// See STYLES section. Defaults to plus-style. pub grep_match_word_style: Option<String>, - #[clap( + #[arg( long = "grep-separator-symbol", default_value = ":", value_name = "STRING" @@ -455,7 +454,7 @@ pub struct Opt { /// lines: set this option to "keep" to keep the original separator symbols. pub grep_separator_symbol: String, - #[clap( + #[arg( long = "hunk-header-decoration-style", default_value = "blue box", value_name = "STYLE" @@ -466,7 +465,7 @@ pub struct Opt { /// 'ul' (underline), 'ol' (overline), or the combination 'ul ol'. pub hunk_header_decoration_style: String, - #[clap( + #[arg( long = "hunk-header-file-style", default_value = "blue", value_name = "STYLE" @@ -477,7 +476,7 @@ pub struct Opt { /// 'file' special attribute. pub hunk_header_file_style: String, - #[clap( + #[arg( long = "hunk-header-line-number-style", default_value = "blue", value_name = "STYLE" @@ -488,7 +487,7 @@ pub struct Opt { /// 'line-number' special attribute. pub hunk_header_line_number_style: String, - #[clap( + #[arg( long = "hunk-header-style", default_value = "line-number syntax", value_name = "STYLE" @@ -500,13 +499,13 @@ pub struct Opt { /// to remove the hunk header section from the output. pub hunk_header_style: String, - #[clap(long = "hunk-label", default_value = "", value_name = "STRING")] + #[arg(long = "hunk-label", default_value = "", value_name = "STRING")] /// Text to display before a hunk header. /// /// Used in the default value of navigate-regex. pub hunk_label: String, - #[clap(long = "hyperlinks")] + #[arg(long = "hyperlinks")] /// Render commit hashes, file names, and line numbers as hyperlinks. /// /// Following the hyperlink spec for terminal emulators: @@ -520,14 +519,14 @@ pub struct Opt { /// https://github.com/dandavison/tmux). pub hyperlinks: bool, - #[clap(long = "hyperlinks-commit-link-format", value_name = "FMT")] + #[arg(long = "hyperlinks-commit-link-format", value_name = "FMT")] /// Format string for commit hyperlinks (requires --hyperlinks). /// /// The placeholder "{commit}" will be replaced by the commit hash. For example: /// --hyperlinks-commit-link-format='https://mygitrepo/{commit}/' pub hyperlinks_commit_link_format: Option<String>, - #[clap( + #[arg( long = "hyperlinks-file-link-format", default_value = "file://{path}", value_name = "FMT" @@ -544,7 +543,7 @@ pub struct Opt { /// https://github.com/dandavison/open-in-editor for an example. pub hyperlinks_file_link_format: String, - #[clap( + #[arg( long = "inline-hint-style", default_value = "blue", value_name = "STYLE" @@ -555,7 +554,7 @@ pub struct Opt { /// to highlight tabs, and the symbols used to indicate wrapped lines. See STYLES section. pub inline_hint_style: String, - #[clap( + #[arg( long = "inspect-raw-lines", default_value = "true", value_name = "true|false" @@ -567,20 +566,20 @@ pub struct Opt { /// Git's --color-moved feature. Set this to "false" to disable this behavior. pub inspect_raw_lines: String, - #[clap(long = "keep-plus-minus-markers")] + #[arg(long = "keep-plus-minus-markers")] /// Prefix added/removed lines with a +/- character, as git does. /// /// By default, delta does not emit any prefix, so code can be copied directly from delta's /// output. pub keep_plus_minus_markers: bool, - #[clap(long = "light")] + #[arg(long = "light")] /// Use default colors appropriate for a light terminal background. /// /// For more control, see the style options and --syntax-theme. pub light: bool, - #[clap(long = "line-buffer-size", default_value = "32", value_name = "N")] + #[arg(long = "line-buffer-size", default_value = "32", value_name = "N")] /// Size of internal line buffer. /// /// Delta compares the added and removed versions of nearby lines in order to detect and @@ -590,7 +589,7 @@ pub struct Opt { /// affect delta's performance when entire files are added/removed. pub line_buffer_size: usize, - #[clap(long = "line-fill-method", value_name = "STRING")] + #[arg(long = "line-fill-method", value_name = "STRING")] /// Line-fill method in side-by-side mode. /// /// How to extend the background color to the end of the line in side-by-side mode. Can be ansi @@ -598,13 +597,13 @@ pub struct Opt { /// --width=variable is given. pub line_fill_method: Option<String>, - #[clap(short = 'n', long = "line-numbers")] + #[arg(short = 'n', long = "line-numbers")] /// Display line numbers next to the diff. /// /// See LINE NUMBERS section. pub line_numbers: bool, - #[clap( + #[arg( long = "line-numbers-left-format", default_value = "{nm:^4}⋮", value_name = "FMT" @@ -616,7 +615,7 @@ pub struct Opt { /// dividing character. See the LINE NUMBERS section. pub line_numbers_left_format: String, - #[clap( + #[arg( long = "line-numbers-left-style", default_value = "auto", value_name = "STYLE" @@ -626,7 +625,7 @@ pub struct Opt { /// See STYLES and LINE NUMBERS sections. pub line_numbers_left_style: String, - #[clap( + #[arg( long = "line-numbers-minus-style", default_value = "auto", value_name = "STYLE" @@ -636,7 +635,7 @@ pub struct Opt { /// See STYLES and LINE NUMBERS sections. pub line_numbers_minus_style: String, - #[clap( + #[arg( long = "line-numbers-plus-style", default_value = "auto", value_name = "STYLE" @@ -646,7 +645,7 @@ pub struct Opt { /// See STYLES and LINE NUMBERS sections. pub line_numbers_plus_style: String, - #[clap( + #[arg( long = "line-numbers-right-format", default_value = "{np:^4}│", value_name = "FMT" @@ -658,7 +657,7 @@ pub struct Opt { /// dividing character, and a space. See the LINE NUMBERS section. pub line_numbers_right_format: String, - #[clap( + #[arg( long = "line-numbers-right-style", default_value = "auto", value_name = "STYLE" @@ -668,7 +667,7 @@ pub struct Opt { /// See STYLES and LINE NUMBERS sections. pub line_numbers_right_style: String, - #[clap( + #[arg( long = "line-numbers-zero-style", default_value = "auto", value_name = "STYLE" @@ -678,21 +677,21 @@ pub struct Opt { /// See STYLES and LINE NUMBERS sections. pub line_numbers_zero_style: String, - #[clap(long = "list-languages")] + #[arg(long = "list-languages")] /// List supported languages and associated file extensions. pub list_languages: bool, - #[clap(long = "list-syntax-themes")] + #[arg(long = "list-syntax-themes")] /// List available syntax-highlighting color themes. pub list_syntax_themes: bool, - #[clap(long = "map-styles", value_name = "STYLES_MAP")] + #[arg(long = "map-styles", value_name = "STYLES_MAP")] /// Map styles encountered in raw input to desired output styles. /// /// An example is --map-styles='bold purple => red "#eeeeee", bold cyan => syntax "#eeeeee"' pub map_styles: Option<String>, - #[clap(long = "max-line-distance", default_value = "0.6", value_name = "DIST")] + #[arg(long = "max-line-distance", default_value = "0.6", value_name = "DIST")] /// Maximum line pair distance parameter in within-line diff algorithm. /// /// This parameter is the maximum distance (0.0 - 1.0) between two lines for them to be inferred @@ -700,7 +699,7 @@ pub struct Opt { /// insertion operations transforming one into the other. pub max_line_distance: f64, - #[clap(long = "max-line-length", default_value = "512", value_name = "N")] + #[arg(long = "max-line-length", default_value = "512", value_name = "N")] /// Truncate lines longer than this. /// /// To prevent any truncation, set to zero. Note that delta will be slow on very long lines @@ -708,7 +707,7 @@ pub struct Opt { /// to fit at least all visible characters. pub max_line_length: usize, - #[clap( + #[arg( long = "merge-conflict-begin-symbol", default_value = "▼", value_name = "STRING" @@ -718,7 +717,7 @@ pub struct Opt { /// The string will be repeated until it reaches the required length. pub merge_conflict_begin_symbol: String, - #[clap( + #[arg( long = "merge-conflict-end-symbol", default_value = "▲", value_name = "STRING" @@ -728,7 +727,7 @@ pub struct Opt { /// The string will be repeated until it reaches the required length. pub merge_conflict_end_symbol: String, - #[clap( + #[arg( long = "merge-conflict-ours-diff-header-decoration-style", default_value = "box", value_name = "STYLE" @@ -740,7 +739,7 @@ pub struct Opt { /// attributes 'box', 'ul' (underline), 'ol' (overline), or the combination 'ul ol'. pub merge_conflict_ours_diff_header_decoration_style: String, - #[clap( + #[arg( long = "merge-conflict-ours-diff-header-style", default_value = "normal", value_name = "STYLE" @@ -750,7 +749,7 @@ pub struct Opt { /// See STYLES section. pub merge_conflict_ours_diff_header_style: String, - #[clap( + #[arg( long = "merge-conflict-theirs-diff-header-decoration-style", default_value = "box", value_name = "STYLE" @@ -762,7 +761,7 @@ pub struct Opt { /// attributes 'box', 'ul' (underline), 'ol' (overline), or the combination 'ul ol'. pub merge_conflict_theirs_diff_header_decoration_style: String, - #[clap( + #[arg( long = "merge-conflict-theirs-diff-header-style", default_value = "normal", value_name = "STYLE" @@ -773,8 +772,8 @@ pub struct Opt { /// STYLES section. pub merge_conflict_theirs_diff_header_style: String, - #[clap( - long = "--minus-empty-line-marker-style", + #[arg( + long = "minus-empty-line-marker-style", default_value = "normal auto", value_name = "STYLE" )] @@ -783,7 +782,7 @@ pub struct Opt { /// Used only if --minus-style has no background color. pub minus_empty_line_marker_style: String, - #[clap( + #[arg( long = "minus-emph-style", default_value = "normal auto", value_name = "STYLE" @@ -793,7 +792,7 @@ pub struct Opt { /// See STYLES section. pub minus_emph_style: String, - #[clap( + #[arg( long = "minus-non-emph-style", default_value = "minus-style", value_name = "STYLE" @@ -803,7 +802,7 @@ pub struct Opt { /// See STYLES section. pub minus_non_emph_style: String, - #[clap( + #[arg( long = "minus-style", default_value = "normal auto", value_name = "STYLE" @@ -813,24 +812,24 @@ pub struct Opt { /// See STYLES section. pub minus_style: String, - #[clap(long = "navigate")] + #[arg(long = "naviga |