summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplustik <70038054+plustik@users.noreply.github.com>2023-11-19 16:20:52 +0100
committerGitHub <noreply@github.com>2023-11-19 10:20:52 -0500
commit49a99180fed618b62ba773e3aebd8968b044262d (patch)
tree09482a18f1cc3e8c3b633f4777f086bc9bbf68cd
parenta5b0ec07cbbca9186a0c86b069d99633c21af128 (diff)
feat: generate completion subcommand (#1561)
* generate-completion subcommand * add Makefile target and replace completion scripts in repo with generated output * Add completion to manual
-rw-r--r--Cargo.lock10
-rw-r--r--Cargo.toml1
-rw-r--r--Makefile5
-rw-r--r--etc/completion/completion.bash433
-rw-r--r--etc/completion/completion.fish205
-rw-r--r--etc/completion/completion.zsh145
-rw-r--r--manual/src/SUMMARY.md1
-rw-r--r--manual/src/tips-and-tricks/shell-completion.md12
-rw-r--r--src/cli.rs25
-rw-r--r--src/main.rs6
-rw-r--r--src/subcommands/generate_completion.rs11
-rw-r--r--src/subcommands/mod.rs1
12 files changed, 683 insertions, 172 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 1f0374ee..6b47c5d1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -303,6 +303,15 @@ dependencies = [
]
[[package]]
+name = "clap_complete"
+version = "4.4.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bffe91f06a11b4b9420f62103854e90867812cd5d01557f853c5ee8e791b12ae"
+dependencies = [
+ "clap",
+]
+
+[[package]]
name = "clap_derive"
version = "4.3.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -559,6 +568,7 @@ dependencies = [
"chrono",
"chrono-humanize",
"clap",
+ "clap_complete",
"console",
"ctrlc",
"dirs",
diff --git a/Cargo.toml b/Cargo.toml
index b54ed5d1..5aa04339 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -43,6 +43,7 @@ unicode-segmentation = "1.10.1"
unicode-width = "0.1.10"
vte = "0.11.0"
xdg = "2.4.1"
+clap_complete = "4.4.4"
[dependencies.git2]
version = "0.17.2"
diff --git a/Makefile b/Makefile
index 61764277..76be99c6 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,9 @@ end-to-end-test: build
./tests/test_deprecated_options > /dev/null
./tests/test_navigate_less_history_file
+shell-completion:
+ for shell in bash fish zsh; do ./target/release/delta --generate-completion $$shell > etc/completion/completion.$$shell; done
+
release:
@make -f release.Makefile release
@@ -44,4 +47,4 @@ flamegraph: build
chronologer:
chronologer etc/performance/chronologer.yaml
-.PHONY: build format lint test unit-test end-to-end-test release version hash benchmark flamegraph chronologer
+.PHONY: build format lint test unit-test end-to-end-test release shell-completion version hash benchmark flamegraph chronologer
diff --git a/etc/completion/completion.bash b/etc/completion/completion.bash
index 03557fbe..5c7de994 100644
--- a/etc/completion/completion.bash
+++ b/etc/completion/completion.bash
@@ -1,69 +1,378 @@
-#!/bin/bash
-
-__delta_previous_extglob_setting=$(shopt -p extglob)
-shopt -s extglob
-
-__delta_complete_commands() {
- COMPREPLY=( $(compgen -W "${commands[*]}" -- "$cur") )
-}
-
-_delta_delta() {
- __delta_complete_commands
-}
-
_delta() {
- local previous_extglob_setting=$(shopt -p extglob)
- shopt -s extglob
-
- local commands=(
- --raw
- --commit-style
- --dark
- --file-style
- --help
- --highlight-removed
- --hunk-style
- --light
- --list-languages
- --list-themes
- --list-theme-names
- --minus-color
- --minus-emph-color
- --plus-color
- --plus-emph-color
- --keep-plus-minus-markers
- --show-background-colors
- --theme
- --version
- --width
- )
-
+ local i cur prev opts cmd
COMPREPLY=()
- local cur prev words cword
- _get_comp_words_by_ref -n : cur prev words cword
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+ cmd=""
+ opts=""
- local command='delta' command_pos=0
- local counter=1
- while [ $counter -lt $cword ]; do
- case "${words[$counter]}" in
- *)
- command="${words[$counter]}"
- command_pos=$counter
- break
- ;;
- esac
- (( counter++ ))
+ for i in ${COMP_WORDS[@]}
+ do
+ case "${cmd},${i}" in
+ ",$1")
+ cmd="delta"
+ ;;
+ *)
+ ;;
+ esac
done
- local completions_func=_delta_${command}
-
- declare -F $completions_func >/dev/null && $completions_func
-
- eval "$previous_extglob_setting"
- return 0
+ case "${cmd}" in
+ delta)
+ opts="-n -s -w -h -V --blame-code-style --blame-format --blame-palette --blame-separator-format --blame-separator-style --blame-timestamp-format --blame-timestamp-output-format --color-only --config --commit-decoration-style --commit-regex --commit-style --dark --default-language --diff-highlight --diff-so-fancy --diff-stat-align-width --features --file-added-label --file-copied-label --file-decoration-style --file-modified-label --file-removed-label --file-renamed-label --file-style --file-transformation --generate-completion --grep-context-line-style --grep-file-style --grep-header-decoration-style --grep-header-file-style --grep-line-number-style --grep-output-type --grep-match-line-style --grep-match-word-style --grep-separator-symbol --hunk-header-decoration-style --hunk-header-file-style --hunk-header-line-number-style --hunk-header-style --hunk-label --hyperlinks --hyperlinks-commit-link-format --hyperlinks-file-link-format --inline-hint-style --inspect-raw-lines --keep-plus-minus-markers --light --line-buffer-size --line-fill-method --line-numbers --line-numbers-left-format --line-numbers-left-style --line-numbers-minus-style --line-numbers-plus-style --line-numbers-right-format --line-numbers-right-style --line-numbers-zero-style --list-languages --list-syntax-themes --map-styles --max-line-distance --max-line-length --merge-conflict-begin-symbol --merge-conflict-end-symbol --merge-conflict-ours-diff-header-decoration-style --merge-conflict-ours-diff-header-style --merge-conflict-theirs-diff-header-decoration-style --merge-conflict-theirs-diff-header-style --minus-empty-line-marker-style --minus-emph-style --minus-non-emph-style --minus-style --navigate --navigate-regex --no-gitconfig --pager --paging --parse-ansi --plus-emph-style --plus-empty-line-marker-style --plus-non-emph-style --plus-style --raw --relative-paths --right-arrow --show-colors --show-config --show-syntax-themes --show-themes --side-by-side --syntax-theme --tabs --true-color --whitespace-error-style --width --word-diff-regex --wrap-left-symbol --wrap-max-lines --wrap-right-percent --wrap-right-prefix-symbol --wrap-right-symbol --zero-style --24-bit-color --help --version [MINUS_FILE] [PLUS_FILE]"
+ if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ fi
+ case "${prev}" in
+ --blame-code-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --blame-format)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --blame-palette)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --blame-separator-format)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --blame-separator-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --blame-timestamp-format)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --blame-timestamp-output-format)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --config)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --commit-decoration-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --commit-regex)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --commit-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --default-language)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --diff-stat-align-width)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --features)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --file-added-label)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --file-copied-label)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --file-decoration-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --file-modified-label)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --file-removed-label)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --file-renamed-label)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --file-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --file-transformation)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --generate-completion)
+ COMPREPLY=($(compgen -W "bash elvish fish powershell zsh" -- "${cur}"))
+ return 0
+ ;;
+ --grep-context-line-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --grep-file-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --grep-header-decoration-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --grep-header-file-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --grep-line-number-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --grep-output-type)
+ COMPREPLY=($(compgen -W "ripgrep classic" -- "${cur}"))
+ return 0
+ ;;
+ --grep-match-line-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --grep-match-word-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --grep-separator-symbol)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --hunk-header-decoration-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --hunk-header-file-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --hunk-header-line-number-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --hunk-header-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --hunk-label)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --hyperlinks-commit-link-format)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --hyperlinks-file-link-format)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --inline-hint-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --inspect-raw-lines)
+ COMPREPLY=($(compgen -W "true false" -- "${cur}"))
+ return 0
+ ;;
+ --line-buffer-size)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --line-fill-method)
+ COMPREPLY=($(compgen -W "ansi spaces" -- "${cur}"))
+ return 0
+ ;;
+ --line-numbers-left-format)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --line-numbers-left-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --line-numbers-minus-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --line-numbers-plus-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --line-numbers-right-format)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --line-numbers-right-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --line-numbers-zero-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --map-styles)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --max-line-distance)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --max-line-length)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --merge-conflict-begin-symbol)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --merge-conflict-end-symbol)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --merge-conflict-ours-diff-header-decoration-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --merge-conflict-ours-diff-header-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --merge-conflict-theirs-diff-header-decoration-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --merge-conflict-theirs-diff-header-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --minus-empty-line-marker-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --minus-emph-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --minus-non-emph-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --minus-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --navigate-regex)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --pager)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --paging)
+ COMPREPLY=($(compgen -W "auto always never" -- "${cur}"))
+ return 0
+ ;;
+ --plus-emph-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --plus-empty-line-marker-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --plus-non-emph-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --plus-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --right-arrow)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --syntax-theme)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --tabs)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --true-color)
+ COMPREPLY=($(compgen -W "auto always never" -- "${cur}"))
+ return 0
+ ;;
+ --whitespace-error-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --width)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ -w)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --word-diff-regex)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --wrap-left-symbol)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --wrap-max-lines)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --wrap-right-percent)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --wrap-right-prefix-symbol)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --wrap-right-symbol)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --zero-style)
+ COMPREPLY=($(compgen -f "${cur}"))
+ return 0
+ ;;
+ --24-bit-color)
+ COMPREPLY=($(compgen -W "auto always never" -- "${cur}"))
+ return 0
+ ;;
+ *)
+ COMPREPLY=()
+ ;;
+ esac
+ COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
+ return 0
+ ;;
+ esac
}
-eval "$__delta_previous_extglob_setting"
-unset __delta_previous_extglob_setting
-
-complete -F _delta -A file delta
+complete -F _delta -o nosort -o bashdefault -o default delta
diff --git a/etc/completion/completion.fish b/etc/completion/completion.fish
index 7bea07ed..760f54b2 100644
--- a/etc/completion/completion.fish
+++ b/etc/completion/completion.fish
@@ -1,99 +1,106 @@
-complete -c delta -l blame-code-style -x -d "Style string for the code section of a git blame line"
-complete -c delta -l blame-format -x -d "Format string for git blame commit metadata"
-complete -c delta -l blame-palette -x -d "Background colors used for git blame lines"
-complete -c delta -l blame-separator-format -x -d "Separator between the blame format and the code section of a git blame line"
-complete -c delta -l blame-separator-style -x -d "Style string for the blame-separator-format"
-complete -c delta -l blame-timestamp-format -x -d "Format of git blame timestamp in raw git output received by delta"
-complete -c delta -l color-only -d "Do not alter the input structurally in any way"
-complete -c delta -l commit-decoration-style -x -d "Style string for the commit hash decoration"
-complete -c delta -l commit-regex -x -d "Regular expression used to identify the commit line when parsing git output"
-complete -c delta -l commit-style -x -d "Style string for the commit hash line"
-complete -c delta -l dark -d "Use default colors appropriate for a dark terminal background"
-complete -c delta -l default-language -x -d "Default language used for syntax highlighting"
-complete -c delta -l diff-highlight -d "Emulate diff-highlight"
-complete -c delta -l diff-so-fancy -d "Emulate diff-so-fancy"
-complete -c delta -l diff-stat-align-width -x -d "Width allocated for file paths in a diff stat section"
-complete -c delta -l features -x -d "Names of delta features to activate"
-complete -c delta -l file-added-label -x -d "Text to display before an added file path"
-complete -c delta -l file-copied-label -x -d "Text to display before a copied file path"
-complete -c delta -l file-decoration-style -x -d "Style string for the file decoration"
-complete -c delta -l file-modified-label -x -d "Text to display before a modified file path"
-complete -c delta -l file-removed-label -x -d "Text to display before a removed file path"
-complete -c delta -l file-renamed-label -x -d "Text to display before a renamed file path"
-complete -c delta -l file-style -x -d "Style string for the file section"
-complete -c delta -l file-transformation -x -d "Sed-style command transforming file paths for display"
-complete -c delta -l grep-context-line-style -x -d "Style string for non-matching lines of grep output"
-complete -c delta -l grep-file-style -x -d "Style string for file paths in grep output"
-complete -c delta -l grep-line-number-style -x -d "Style string for line numbers in grep output"
-complete -c delta -l grep-match-line-style -x -d "Style string for matching lines of grep output"
-complete -c delta -l grep-match-word-style -x -d "Style string for the matching substrings within a matching line of grep output"
-complete -c delta -l grep-separator-symbol -x -d "Separator symbol printed after the file path and line number in grep output"
-complete -c delta -l hunk-header-decoration-style -x -d "Style string for the hunk-header decoration"
-complete -c delta -l hunk-header-file-style -x -d "Style string for the file path part of the hunk-header"
-complete -c delta -l hunk-header-line-number-style -x -d "Style string for the line number part of the hunk-header"
-complete -c delta -l hunk-header-style -x -d "Style string for the hunk-header"
-complete -c delta -l hunk-label -x -d "Text to display before a hunk header"
-complete -c delta -l hyperlinks -d "Render commit hashes, file names, and line numbers as hyperlinks"
-complete -c delta -l hyperlinks-commit-link-format -x -d "Format string for commit hyperlinks"
-complete -c delta -l hyperlinks-file-link-format -x -d "Format string for file hyperlinks"
-complete -c delta -l inline-hint-style -x -d "Style string for short inline hint text"
-complete -c delta -l inspect-raw-lines -xa "true false" -d "Kill-switch for --color-moved support"
-complete -c delta -l keep-plus-minus-markers -d "Prefix added/removed lines with a +/- character"
-complete -c delta -l light -d "Use default colors appropriate for a light terminal background"
-complete -c delta -l line-buffer-size -x -d "Size of internal line buffer"
-complete -c delta -l line-fill-method -xa "ansi spaces" -d "Line-fill method in side-by-side mode"
-complete -c delta -l line-numbers -s n -d "Display line numbers next to the diff"
-complete -c delta -l line-numbers-left-format -x -d "Format string for the left column of line numbers"
-complete -c delta -l line-numbers-left-style -x -d "Style string for the left column of line numbers"
-complete -c delta -l line-numbers-minus-style -x -d "Style string for line numbers in the old (minus) version of the file"
-complete -c delta -l line-numbers-plus-style -x -d "Style string for line numbers in the new (plus) version of the file"
-complete -c delta -l line-numbers-right-format -x -d "Format string for the right column of line numbers"
-complete -c delta -l line-numbers-right-style -x -d "Style string for the right column of line numbers"
-complete -c delta -l line-numbers-zero-style -x -d "Style string for line numbers in unchanged (zero) lines"
-complete -c delta -l list-languages -d "List supported languages and associated file extensions"
-complete -c delta -l list-syntax-themes -d "List available syntax-highlighting color themes"
-complete -c delta -l map-styles -x -d "Map styles encountered in raw input to desired output styles"
-complete -c delta -l max-line-distance -x -d "Maximum line pair distance parameter in within-line diff algorithm"
-complete -c delta -l max-line-length -x -d "Truncate lines longer than this"
-complete -c delta -l merge-conflict-begin-symbol -x -d "String marking the beginning of a merge conflict region"
-complete -c delta -l merge-conflict-end-symbol -x -d "String marking the end of a merge conflict region"
-complete -c delta -l merge-conflict-ours-diff-header-decoration-style -x -d "Style string for the decoration of the header above the 'ours' merge conflict diff"
-complete -c delta -l merge-conflict-ours-diff-header-style -x -d "Style string for the header above the 'ours' branch merge conflict diff"
-complete -c delta -l merge-conflict-theirs-diff-header-decoration-style -x -d "Style string for the decoration of the header above the 'theirs' merge conflict diff"
-complete -c delta -l merge-conflict-theirs-diff-header-style -x -d "Style string for the header above the 'theirs' branch merge conflict diff"
-complete -c delta -l minus-empty-line-marker-style -x -d "Style string for removed empty line marker"
-complete -c delta -l minus-emph-style -x -d "Style string for emphasized sections of removed lines"
-complete -c delta -l minus-non-emph-style -x -d "Style string for non-emphasized sections of removed lines that have an emphasized section"
-complete -c delta -l minus-style -x -d "Style string for removed lines"
-complete -c delta -l navigate -d "Activate diff navigation"
-complete -c delta -l navigate-regex -x -d "Regular expression defining navigation stop points"
-complete -c delta -l no-gitconfig -d "Do not read any settings from git config"
-complete -c delta -l pager -x -d "Which pager to use"
-complete -c delta -l paging -xa "auto always never" -d "Whether to use a pager when displaying output"
-complete -c delta -l parse-ansi -d "Display ANSI color escape sequences in human-readable form"
-complete -c delta -l plus-emph-style -x -d "Style string for emphasized sections of added lines"
-complete -c delta -l plus-empty-line-marker-style -x -d "Style string for added empty line marker"
-complete -c delta -l plus-non-emph-style -x -d "Style string for non-emphasized sections of added lines that have an emphasized section"
-complete -c delta -l plus-style -x -d "Style string for added lines"
-complete -c delta -l raw -d "Do not alter the input in any way"
-complete -c delta -l relative-paths -d "Output all file paths relative to the current directory"
-complete -c delta -l right-arrow -x -d "Text to display with a changed file path"
-complete -c delta -l show-colors -d "Show available named colors"
-complete -c delta -l show-config -d "Display the active values for all Delta options"
-complete -c delta -l show-syntax-themes -d "Show example diff for available syntax-highlighting themes"
-complete -c delta -l show-themes -d "Show example diff for available delta themes"
-complete -c delta -l side-by-side -s s -d "Display diffs in side-by-side layout"
-complete -c delta -l syntax-theme -xa "(delta --list-syntax-themes | cut -f 2)" -d "The syntax-highlighting theme to use"
-complete -c delta -l tabs -x -d "The number of spaces to replace tab characters with"
-complete -c delta -l true-color -xa "auto always never" -d "Whether to emit 24-bit RGB color codes"
-complete -c delta -l whitespace-error-style -x -d "Style string for whitespace errors"
-complete -c delta -l width -s w -x -d "The width of underline/overline decorations"
-complete -c delta -l word-diff-regex -x -d "Regular expression defining a 'word' in within-line diff algorithm"
-complete -c delta -l wrap-left-symbol -x -d "End-of-line wrapped content symbol"
-complete -c delta -l wrap-max-lines -x -d "How often a line should be wrapped if it does not fit"
-complete -c delta -l wrap-right-percent -x -d "Threshold for right-aligning wrapped content"
-complete -c delta -l wrap-right-prefix-symbol -x -d "Pre-wrapped content symbol"
-complete -c delta -l wrap-right-symbol -x -d "End-of-line wrapped content symbol"
-complete -c delta -l zero-style -x -d "Style string for unchanged lines"
-complete -c delta -l help -s h -d "Print help information"
-complete -c delta -l version -s V -d "Print version information"
+complete -c delta -l blame-code-style -d 'Style string for the code section of a git blame line' -r
+complete -c delta -l blame-format -d 'Format string for git blame commit metadata' -r
+complete -c delta -l blame-palette -d 'Background colors used for git blame lines (space-separated string)' -r
+complete -c delta -l blame-separator-format -d 'Separator between the blame format and the code section of a git blame line' -r
+complete -c delta -l blame-separator-style -d 'Style string for the blame-separator-format' -r
+complete -c delta -l blame-timestamp-format -d 'Format of `git blame` timestamp in raw git output received by delta' -r
+complete -c delta -l blame-timestamp-output-format -d 'Format string for git blame timestamp output' -r
+complete -c delta -l config -d 'Load the config file at PATH instead of ~/.gitconfig' -r -F
+complete -c delta -l commit-decoration-style -d 'Style string for the commit hash decoration' -r
+complete -c delta -l commit-regex -d 'Regular expression used to identify the commit line when parsing git output' -r
+complete -c delta -l commit-style -d 'Style string for the commit hash line' -r
+complete -c delta -l default-language -d 'Default language used for syntax highlighting' -r
+complete -c delta -l diff-stat-align-width -d 'Width allocated for file paths in a diff stat section' -r
+complete -c delta -l features -d 'Names of delta features to activate (space-separated)' -r
+complete -c delta -l file-added-label -d 'Text to display before an added file path' -r
+complete -c delta -l file-copied-label -d 'Text to display before a copied file path' -r
+complete -c delta -l file-decoration-style -d 'Style string for the file decoration' -r
+complete -c delta -l file-modified-label -d 'Text to display before a modified file path' -r
+complete -c delta -l file-removed-label -d 'Text to display before a removed file path' -r
+complete -c delta -l file-renamed-label -d 'Text to display before a renamed file path' -r
+complete -c delta -l file-style -d 'Style string for the file section' -r
+complete -c delta -l file-transformation -d 'Sed-style command transforming file paths for display' -r
+complete -c delta -l generate-completion -d 'Print completion file for the given shell' -r -f -a "{bash '',elvish '',fish '',powershell '',zsh ''}"
+complete -c delta -l grep-context-line-style -d 'Style string for non-matching lines of grep output' -r
+complete -c delta -l grep-file-style -d 'Style string for file paths in grep output' -r
+complete -c delta -l grep-header-decoration-style -d 'Style string for the header decoration in grep output' -r
+complete -c delta -l grep-header-file-style -d 'Style string for the file path part of the header in grep output' -r
+complete -c delta -l grep-line-number-style -d 'Style string for line numbers in grep output' -r
+complete -c delta -l grep-output-type -d 'Grep output format. Possible values: "ripgrep" - file name printed once, followed by matching lines within that file, each preceded by a line number. "classic" - file name:line number, followed by matching line. Default is "ripgrep" if `r