completion: Finish args

This commit is contained in:
Dylan Araps 2018-05-30 14:28:18 +10:00
parent 0e73d7c9ae
commit a1bf937fd8
2 changed files with 234 additions and 5 deletions

View file

@ -1,12 +1,12 @@
#!/usr/bin/env bash
#
# Shell completion for neofetch.
shopt -s nullglob
_neofetch_completions() {
local flags cur prev usage config
local flags cur prev usage
usage="$(neofetch --help)"
config="$(neofetch --print_config)"
# User input.
cur="${COMP_WORDS[COMP_CWORD]}"
@ -28,8 +28,19 @@ _neofetch_completions() {
;;
"--backend")
IFS=$'\n' read -d "" -ra COMPREPLY \
< <(awk -F\' '/ Shortcut/ {print $2}' <<< "$usage")
COMPREPLY=(
"ascii"
"caca"
"iterm2"
"jp2a"
"kitty"
"pixterm"
"sixel"
"termpix"
"tycat"
"w3m"
"off"
)
;;
"--os_arch"|\
@ -183,6 +194,225 @@ _neofetch_completions() {
{1..9}
)
;;
"--cpu_display"|\
"--memory_display"|\
"--battery_display"|\
"--disk_display")
COMPREPLY=(
"bar"
"infobar"
"barinfo"
"off"
)
;;
"--source"|\
"--ascii"|\
"--caca"|\
"--iterm2"|\
"--jp2a"|\
"--kitty"|\
"--pixterm"|\
"--sixel"|\
"--termpix"|\
"--tycat"|\
"--w3m")
COMPREPLY=(
"auto"
"ascii"
"wallpaper"
"/path/to/img.jpg"
"/path/to/images"
"/path/to/ascii_file"
)
;;
"--ascii_distro")
COMPREPLY=(
"aix"
"alpine"
"alpine_small"
"amazon"
"anarchy"
"android"
"antergos"
"antix"
"aosc"
"apricity"
"arch"
"arch_old"
"arch_small"
"archbox"
"archlabs"
"archmerge"
"arcolinux"
"artix"
"arya"
"bitrig"
"blag"
"blankon"
"bsd"
"bunsenlabs"
"calculate"
"centos"
"chakra"
"chaletos"
"chapeau"
"chrom"
"clover"
"crux"
"crux_small"
"darwin"
"debian"
"debian_small"
"deepin"
"desaos"
"devuan"
"dracos"
"dragonfly"
"dragonfly_old"
"dragonfly_small"
"elementary"
"endless"
"exherbo"
"fedora"
"freebsd"
"freebsd_small"
"freemint"
"frugalware"
"funtoo"
"galliumos"
"gentoo"
"gentoo_small"
"gnewsense"
"gnu"
"gobolinux"
"grombyang"
"guixsd"
"haiku"
"hyperbola"
"irix"
"kali"
"kaos"
"kde"
"kogaion"
"korora"
"kslinux"
"kubuntu"
"lede"
"linux"
"linux mint"
"lmde"
"lubuntu"
"lunar"
"mac"
"mageia"
"magpieos"
"manjaro"
"maui"
"mer"
"minix"
"mx"
"netbsd"
"netrunner"
"nitrux"
"nixos"
"nixos_small"
"nurunner"
"nutyx"
"obrevenge"
"open source media center"
"openbsd"
"openbsd_small"
"openindiana"
"openmandriva"
"opensuse"
"openwrt"
"oracle"
"pacbsd"
"parabola"
"pardus"
"parrot"
"parsix"
"pcbsd"
"pclinuxos"
"peppermint"
"porteus"
"postmarketos"
"puppy"
"qubes"
"raspbian"
"red star"
"redcore"
"redhat"
"rosa"
"sabayon"
"sabotage"
"sailfishos"
"salentos"
"scientific"
"siduction"
"slackware"
"slitaz"
"smartos"
"solus"
"sparky"
"steamos"
"sunos"
"swagarch"
"tails"
"trisquel"
"ubuntu"
"ubuntu_old"
"void"
"void_small"
"windows"
"windows 10"
"xferience"
"xubuntu"
"zorin"
)
;;
"--size")
COMPREPLY=(
"00px"
"00%"
"auto"
"none"
)
;;
"--crop_mode")
COMPREPLY=(
"normal"
"fit"
"fill"
)
;;
"--crop_offset")
COMPREPLY=(
"northwest"
"north"
"northeast"
"west"
"center"
"east"
"southwest"
"south"
"southeast"
)
;;
"--config")
COMPREPLY=(
"none"
"/path/to/config"
)
;;
esac
}

View file

@ -4494,7 +4494,6 @@ ASCII:
--ascii_bold on/off Whether or not to bold the ascii logo.
-L, --logo Hide the info text and only show the ascii logo.
Possible values: bar, infobar, barinfo, off
IMAGE:
--loop Redraw the image constantly until Ctrl+C is used. This fixes issues