feat(completions): Add shell completions for --absolute flag

This commit is contained in:
Tamino Bauknecht 2024-01-21 22:12:23 +01:00 committed by Christina E. Sørensen
parent 084ed33a35
commit 05ae8e91a2
4 changed files with 12 additions and 0 deletions

View file

@ -47,6 +47,11 @@ _eza() {
mapfile -t COMPREPLY < <(compgen -W 'fixed gradient --' -- "$cur")
return
;;
--absolute)
mapfile -t COMPREPLY < <(compgen -W 'on follow off --' -- "$cur")
return
;;
esac
case "$cur" in

View file

@ -38,6 +38,11 @@ complete -c eza -l icons -d "When to display icons" -x -a "
"
complete -c eza -l no-quotes -d "Don't quote file names with spaces"
complete -c eza -l hyperlink -d "Display entries as hyperlinks"
complete -c eza -l absolute -d "Display entries with their absolute path" -x -a "
on\t'Show absolute path for listed entries'
follow\t'Show absolute path with followed symlinks'
off\t'Do not show the absolute path'
"
complete -c eza -l smart-group -d "Only show group if it has a different name from owner"
# Filtering and sorting options

View file

@ -18,6 +18,7 @@ export extern "eza" [
--icons # When to display icons
--no-quotes # Don't quote file names with spaces
--hyperlink # Display entries as hyperlinks
--absolute # Display entries with their absolute path
--group-directories-first # Sort directories before other files
--git-ignore # Ignore files mentioned in '.gitignore'
--all(-a) # Show hidden and 'dot' files. Use this twice to also show the '.' and '..' directories

View file

@ -26,6 +26,7 @@ __eza() {
--icons="[When to display icons]:(when):(always auto automatic never)" \
--no-quotes"[Don't quote filenames with spaces]" \
--hyperlink"[Display entries as hyperlinks]" \
--absolute"[Display entries with their absolute path]:(mode):(on follow off)" \
--group-directories-first"[Sort directories before other files]" \
--git-ignore"[Ignore files mentioned in '.gitignore']" \
{-a,--all}"[Show hidden and 'dot' files. Use this twice to also show the '.' and '..' directories]" \