From b4a59f5467bf62b164e1d99f38a8a88e85cbd264 Mon Sep 17 00:00:00 2001 From: KyMAN <0kyman0@gmail.com> Date: Sun, 12 Apr 2026 21:00:27 +0200 Subject: [PATCH] =?UTF-8?q?#wip(cs):=20Done.=20Needs=20=20and=20BASH=3D/us?= =?UTF-8?q?r/bin/bash=20BASHOPTS=3Dcheckwinsize:cmdhist:complete=5Ffullquo?= =?UTF-8?q?te:expand=5Faliases:extglob:extquote:force=5Ffignore:globasciir?= =?UTF-8?q?anges:globskipdots:histappend:interactive=5Fcomments:patsub=5Fr?= =?UTF-8?q?eplacement:progcomp:promptvars:sourcepath=20BASH=5FALIASES=3D()?= =?UTF-8?q?=20BASH=5FARGC=3D([0]=3D"0")=20BASH=5FARGV=3D()=20BASH=5FCMDS?= =?UTF-8?q?=3D()=20BASH=5FCOMPLETION=5FVERSINFO=3D([0]=3D"2"=20[1]=3D"11")?= =?UTF-8?q?=20BASH=5FLINENO=3D()=20BASH=5FLOADABLES=5FPATH=3D/usr/local/li?= =?UTF-8?q?b/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt?= =?UTF-8?q?/pkg/lib/bash:.=20BASH=5FREMATCH=3D()=20BASH=5FSOURCE=3D()=20BA?= =?UTF-8?q?SH=5FVERSINFO=3D([0]=3D"5"=20[1]=3D"2"=20[2]=3D"21"=20[3]=3D"1"?= =?UTF-8?q?=20[4]=3D"release"=20[5]=3D"x86=5F64-pc-linux-gnu")=20BASH=5FVE?= =?UTF-8?q?RSION=3D'5.2.21(1)-release'=20COLORTERM=3Dtruecolor=20COLUMNS?= =?UTF-8?q?=3D272=20COMP=5FWORDBREAKS=3D$'=20\t\n"\'><=3D;|&(:'=20DBUS=5FS?= =?UTF-8?q?ESSION=5FBUS=5FADDRESS=3Dunix:path=3D/run/user/1000/bus=20DEBUG?= =?UTF-8?q?INFOD=5FURLS=3D'https://debuginfod.ubuntu.com=20'=20DESKTOP=5FS?= =?UTF-8?q?ESSION=3Dgnome=20DIRSTACK=3D()=20DISPLAY=3D:1=20DOTNET=5FBUNDLE?= =?UTF-8?q?=5FEXTRACT=5FBASE=5FDIR=3D/home/kyman/.cache/dotnet=5Fbundle=5F?= =?UTF-8?q?extract=20EUID=3D1000=20GDMSESSION=3Dgnome=20GNOME=5FDESKTOP=5F?= =?UTF-8?q?SESSION=5FID=3Dthis-is-deprecated=20GNOME=5FKEYRING=5FCONTROL?= =?UTF-8?q?=3D/run/user/1000/keyring=20GNOME=5FTERMINAL=5FSCREEN=3D/org/gn?= =?UTF-8?q?ome/Terminal/screen/0a8ab02a=5Fa645=5F4fb0=5F8b50=5F79b274e447f?= =?UTF-8?q?9=20GNOME=5FTERMINAL=5FSERVICE=3D:1.170=20GPG=5FAGENT=5FINFO=3D?= =?UTF-8?q?/run/user/1000/gnupg/S.gpg-agent:0:1=20GROUPS=3D()=20GSM=5FSKIP?= =?UTF-8?q?=5FSSH=5FAGENT=5FWORKAROUND=3Dtrue=20GTK=5FMODULES=3Dgail:atk-b?= =?UTF-8?q?ridge=20HISTCONTROL=3Dignoreboth=20HISTFILE=3D/home/kyman/.bash?= =?UTF-8?q?=5Fhistory=20HISTFILESIZE=3D2000=20HISTSIZE=3D1000=20HOME=3D/ho?= =?UTF-8?q?me/kyman=20HOSTNAME=3Dkyman-GS75-9SE=20HOSTTYPE=3Dx86=5F64=20IF?= =?UTF-8?q?S=3D$'=20\t\n'=20LANG=3Des=5FES.UTF-8=20LESSCLOSE=3D'/usr/bin/l?= =?UTF-8?q?esspipe=20%s=20%s'=20LESSOPEN=3D'|=20/usr/bin/lesspipe=20%s'=20?= =?UTF-8?q?LINES=3D66=20LOGNAME=3Dkyman=20LS=5FCOLORS=3D'rs=3D0:di=3D01;34?= =?UTF-8?q?:ln=3D01;36:mh=3D00:pi=3D40;33:so=3D01;35:do=3D01;35:bd=3D40;33?= =?UTF-8?q?;01:cd=3D40;33;01:or=3D40;31;01:mi=3D00:su=3D37;41:sg=3D30;43:c?= =?UTF-8?q?a=3D00:tw=3D30;42:ow=3D34;42:st=3D37;44:ex=3D01;32:*.tar=3D01;3?= =?UTF-8?q?1:*.tgz=3D01;31:*.arc=3D01;31:*.arj=3D01;31:*.taz=3D01;31:*.lha?= =?UTF-8?q?=3D01;31:*.lz4=3D01;31:*.lzh=3D01;31:*.lzma=3D01;31:*.tlz=3D01;?= =?UTF-8?q?31:*.txz=3D01;31:*.tzo=3D01;31:*.t7z=3D01;31:*.zip=3D01;31:*.z?= =?UTF-8?q?=3D01;31:*.dz=3D01;31:*.gz=3D01;31:*.lrz=3D01;31:*.lz=3D01;31:*?= =?UTF-8?q?.lzo=3D01;31:*.xz=3D01;31:*.zst=3D01;31:*.tzst=3D01;31:*.bz2=3D?= =?UTF-8?q?01;31:*.bz=3D01;31:*.tbz=3D01;31:*.tbz2=3D01;31:*.tz=3D01;31:*.?= =?UTF-8?q?deb=3D01;31:*.rpm=3D01;31:*.jar=3D01;31:*.war=3D01;31:*.ear=3D0?= =?UTF-8?q?1;31:*.sar=3D01;31:*.rar=3D01;31:*.alz=3D01;31:*.ace=3D01;31:*.?= =?UTF-8?q?zoo=3D01;31:*.cpio=3D01;31:*.7z=3D01;31:*.rz=3D01;31:*.cab=3D01?= =?UTF-8?q?;31:*.wim=3D01;31:*.swm=3D01;31:*.dwm=3D01;31:*.esd=3D01;31:*.a?= =?UTF-8?q?vif=3D01;35:*.jpg=3D01;35:*.jpeg=3D01;35:*.mjpg=3D01;35:*.mjpeg?= =?UTF-8?q?=3D01;35:*.gif=3D01;35:*.bmp=3D01;35:*.pbm=3D01;35:*.pgm=3D01;3?= =?UTF-8?q?5:*.ppm=3D01;35:*.tga=3D01;35:*.xbm=3D01;35:*.xpm=3D01;35:*.tif?= =?UTF-8?q?=3D01;35:*.tiff=3D01;35:*.png=3D01;35:*.svg=3D01;35:*.svgz=3D01?= =?UTF-8?q?;35:*.mng=3D01;35:*.pcx=3D01;35:*.mov=3D01;35:*.mpg=3D01;35:*.m?= =?UTF-8?q?peg=3D01;35:*.m2v=3D01;35:*.mkv=3D01;35:*.webm=3D01;35:*.webp?= =?UTF-8?q?=3D01;35:*.ogm=3D01;35:*.mp4=3D01;35:*.m4v=3D01;35:*.mp4v=3D01;?= =?UTF-8?q?35:*.vob=3D01;35:*.qt=3D01;35:*.nuv=3D01;35:*.wmv=3D01;35:*.asf?= =?UTF-8?q?=3D01;35:*.rm=3D01;35:*.rmvb=3D01;35:*.flc=3D01;35:*.avi=3D01;3?= =?UTF-8?q?5:*.fli=3D01;35:*.flv=3D01;35:*.gl=3D01;35:*.dl=3D01;35:*.xcf?= =?UTF-8?q?=3D01;35:*.xwd=3D01;35:*.yuv=3D01;35:*.cgm=3D01;35:*.emf=3D01;3?= =?UTF-8?q?5:*.ogv=3D01;35:*.ogx=3D01;35:*.aac=3D00;36:*.au=3D00;36:*.flac?= =?UTF-8?q?=3D00;36:*.m4a=3D00;36:*.mid=3D00;36:*.midi=3D00;36:*.mka=3D00;?= =?UTF-8?q?36:*.mp3=3D00;36:*.mpc=3D00;36:*.ogg=3D00;36:*.ra=3D00;36:*.wav?= =?UTF-8?q?=3D00;36:*.oga=3D00;36:*.opus=3D00;36:*.spx=3D00;36:*.xspf=3D00?= =?UTF-8?q?;36:*~=3D00;90:*#=3D00;90:*.bak=3D00;90:*.crdownload=3D00;90:*.?= =?UTF-8?q?dpkg-dist=3D00;90:*.dpkg-new=3D00;90:*.dpkg-old=3D00;90:*.dpkg-?= =?UTF-8?q?tmp=3D00;90:*.old=3D00;90:*.orig=3D00;90:*.part=3D00;90:*.rej?= =?UTF-8?q?=3D00;90:*.rpmnew=3D00;90:*.rpmorig=3D00;90:*.rpmsave=3D00;90:*?= =?UTF-8?q?.swp=3D00;90:*.tmp=3D00;90:*.ucf-dist=3D00;90:*.ucf-new=3D00;90?= =?UTF-8?q?:*.ucf-old=3D00;90:'=20MACHTYPE=3Dx86=5F64-pc-linux-gnu=20MAILC?= =?UTF-8?q?HECK=3D60=20MEMORY=5FPRESSURE=5FWATCH=3D/sys/fs/cgroup/user.sli?= =?UTF-8?q?ce/user-1000.slice/user@1000.service/session.slice/org.gnome.Se?= =?UTF-8?q?ttingsDaemon.MediaKeys.service/memory.pressure=20MEMORY=5FPRESS?= =?UTF-8?q?URE=5FWRITE=3Dc29tZSAyMDAwMDAgMjAwMDAwMAA=3D=20OLDPWD=3D/media/?= =?UTF-8?q?kyman/SSD2TB/git.lite/ErrorsManager/CSharp=20OPTERR=3D1=20OPTIN?= =?UTF-8?q?D=3D1=20OSTYPE=3Dlinux-gnu=20PATH=3D/home/kyman/.cargo/bin:/hom?= =?UTF-8?q?e/kyman/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/us?= =?UTF-8?q?r/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bi?= =?UTF-8?q?n:/home/kyman/.dotnet/tools=20PIPESTATUS=3D([0]=3D"0")=20PPID?= =?UTF-8?q?=3D108860=20PS1=3D'\[\e]0;\u@\h:=20\w\a\]${debian=5Fchroot:+($d?= =?UTF-8?q?ebian=5Fchroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\?= =?UTF-8?q?]\w\[\033[00m\]\$=20'=20PS2=3D'>=20'=20PS4=3D'+=20'=20PWD=3D/me?= =?UTF-8?q?dia/kyman/SSD2TB/git.lite/ErrorsManager=20QT=5FACCESSIBILITY=3D?= =?UTF-8?q?1=20QT=5FIM=5FMODULE=3Dibus=20SESSION=5FMANAGER=3Dlocal/kyman-G?= =?UTF-8?q?S75-9SE:@/tmp/.ICE-unix/8014,unix/kyman-GS75-9SE:/tmp/.ICE-unix?= =?UTF-8?q?/8014=20SHELL=3D/bin/bash=20SHELLOPTS=3Dbraceexpand:emacs:hasha?= =?UTF-8?q?ll:histexpand:history:interactive-comments:monitor=20SHLVL=3D1?= =?UTF-8?q?=20SSH=5FAUTH=5FSOCK=3D/run/user/1000/keyring/ssh=20SYSTEMD=5FE?= =?UTF-8?q?XEC=5FPID=3D8544=20TERM=3Dxterm-256color=20UID=3D1000=20USER=3D?= =?UTF-8?q?kyman=20USERNAME=3Dkyman=20VTE=5FVERSION=3D7600=20WINDOWPATH=3D?= =?UTF-8?q?2=20XAUTHORITY=3D/run/user/1000/gdm/Xauthority=20XDG=5FCONFIG?= =?UTF-8?q?=5FDIRS=3D/etc/xdg/xdg-gnome:/etc/xdg=20XDG=5FCURRENT=5FDESKTOP?= =?UTF-8?q?=3DGNOME=20XDG=5FDATA=5FDIRS=3D/usr/share/gnome:/usr/local/shar?= =?UTF-8?q?e/:/usr/share/:/var/lib/snapd/desktop=20XDG=5FMENU=5FPREFIX=3Dg?= =?UTF-8?q?nome-=20XDG=5FRUNTIME=5FDIR=3D/run/user/1000=20XDG=5FSESSION=5F?= =?UTF-8?q?CLASS=3Duser=20XDG=5FSESSION=5FDESKTOP=3Dgnome=20XDG=5FSESSION?= =?UTF-8?q?=5FTYPE=3Dx11=20XMODIFIERS=3D@im=3Dibus=20=5F=3D.=20=5F=5Fgit?= =?UTF-8?q?=5Fprintf=5Fsupports=5Fv=3Dyes=20=5Fbackup=5Fglob=3D'@(#*#|*@(~?= =?UTF-8?q?|.@(bak|orig|rej|swp|dpkg*|rpm@(orig|new|save))))'=20=5Fxspecs?= =?UTF-8?q?=3D([tex]=3D"!*.@(=3F(la)tex|texi|dtx|ins|ltx|dbj)"=20[freeamp]?= =?UTF-8?q?=3D"!*.@(mp3|og[ag]|pls|m3u)"=20[gqmpeg]=3D"!*.@(mp3|og[ag]|pls?= =?UTF-8?q?|m3u)"=20[texi2html]=3D"!*.texi*"=20[hbpp]=3D"!*.@([Pp][Rr][Gg]?= =?UTF-8?q?|[Cc][Ll][Pp])"=20[lowriter]=3D"!*.@(sxw|stw|sxg|sgl|doc=3F([mx?= =?UTF-8?q?])|dot=3F([mx])|rtf|txt|htm|html|=3F(f)odt|ott|odm|pdf)"=20[rpm?= =?UTF-8?q?2cpio]=3D"!*.[rs]pm"=20[localc]=3D"!*.@(sxc|stc|xls=3F([bmx])|x?= =?UTF-8?q?lw|xlt=3F([mx])|[ct]sv|=3F(f)ods|ots)"=20[hbrun]=3D"!*.[Hh][Rr]?= =?UTF-8?q?[Bb]"=20[vi]=3D"*.@([ao]|so|so.!(conf|*/*)|[rs]pm|gif|jp=3F(e)g?= =?UTF-8?q?|mp3|mp=3F(e)g|avi|asf|ogg|class)"=20[latex]=3D"!*.@(=3F(la)tex?= =?UTF-8?q?|texi|dtx|ins|ltx|dbj)"=20[view]=3D"*.@([ao]|so|so.!(conf|*/*)|?= =?UTF-8?q?[rs]pm|gif|jp=3F(e)g|mp3|mp=3F(e)g|avi|asf|ogg|class)"=20[madpl?= =?UTF-8?q?ay]=3D"!*.mp3"=20[compress]=3D"*.Z"=20[pdfjadetex]=3D"!*.@(=3F(?= =?UTF-8?q?la)tex|texi|dtx|ins|ltx|dbj)"=20[pbunzip2]=3D"!*.=3F(t)bz=3F(2)?= =?UTF-8?q?"=20[lrunzip]=3D"!*.lrz"=20[gunzip]=3D"!*.@(Z|[gGd]z|t[ag]z)"?= =?UTF-8?q?=20[oowriter]=3D"!*.@(sxw|stw|sxg|sgl|doc=3F([mx])|dot=3F([mx])?= =?UTF-8?q?|rtf|txt|htm|html|=3F(f)odt|ott|odm|pdf)"=20[epiphany]=3D"!*.@(?= =?UTF-8?q?=3F([xX]|[sS])[hH][tT][mM]=3F([lL]))"=20[acroread]=3D"!*.[pf]df?= =?UTF-8?q?"=20[znew]=3D"*.Z"=20[kwrite]=3D"*.@([ao]|so|so.!(conf|*/*)|[rs?= =?UTF-8?q?]pm|gif|jp=3F(e)g|mp3|mp=3F(e)g|avi|asf|ogg|class)"=20[xemacs]?= =?UTF-8?q?=3D"*.@([ao]|so|so.!(conf|*/*)|[rs]pm|gif|jp=3F(e)g|mp3|mp=3F(e?= =?UTF-8?q?)g|avi|asf|ogg|class)"=20[gview]=3D"*.@([ao]|so|so.!(conf|*/*)|?= =?UTF-8?q?[rs]pm|gif|jp=3F(e)g|mp3|mp=3F(e)g|avi|asf|ogg|class)"=20[lzfgr?= =?UTF-8?q?ep]=3D"!*.@(tlz|lzma)"=20[lzless]=3D"!*.@(tlz|lzma)"=20[cdiff]?= =?UTF-8?q?=3D"!*.@(dif=3F(f)|=3F(d)patch)=3F(.@([gx]z|bz2|lzma))"=20[zipi?= =?UTF-8?q?nfo]=3D"!*.@(zip|[aegjswx]ar|exe|pk3|wsz|zargo|xpi|s[tx][cdiw]|?= =?UTF-8?q?sx[gm]|o[dt][tspgfc]|od[bm]|oxt|epub|apk|aab|ipa|do[ct][xm]|p[o?= =?UTF-8?q?p]t[mx]|xl[st][xm]|pyz|whl|[Ff][Cc][Ss]td)"=20[pdflatex]=3D"!*.?= =?UTF-8?q?@(=3F(la)tex|texi|dtx|ins|ltx|dbj)"=20[portecle]=3D"!@(*.@(ks|j?= =?UTF-8?q?ks|jceks|p12|pfx|bks|ubr|gkr|cer|crt|cert|p7b|pkipath|pem|p10|c?= =?UTF-8?q?sr|crl)|cacerts)"=20[modplugplay]=3D"!*.@(669|abc|am[fs]|d[bs]m?= =?UTF-8?q?|dmf|far|it|mdl|m[eo]d|mid=3F(i)|mt[2m]|oct|okt=3F(a)|p[st]m|s[?= =?UTF-8?q?3t]m|ult|umx|wav|xm)"=20[lokalize]=3D"!*.po"=20[lbzcat]=3D"!*.?= =?UTF-8?q?=3F(t)bz=3F(2)"=20[qiv]=3D"!*.@(gif|jp=3F(e)g|tif=3F(f)|png|p[b?= =?UTF-8?q?gp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm|svg)"=20[totem]=3D"!*@(.@(m?= =?UTF-8?q?p=3F(e)g|MP=3F(E)G|wm[av]|WM[AV]|avi|AVI|asf|vob|VOB|bin|dat|di?= =?UTF-8?q?vx|DIVX|vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|rm|ram|yuv|mov|MOV|q?= =?UTF-8?q?t|QT|web[am]|WEB[AM]|mp[234]|MP[234]|m=3F(p)4[av]|M=3F(P)4[AV]|?= =?UTF-8?q?mkv|MKV|og[agmvx]|OG[AGMVX]|t[ps]|T[PS]|m2t=3F(s)|M2T=3F(S)|mts?= =?UTF-8?q?|MTS|wav|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m?= =?UTF-8?q?|S[3T]M|it|IT|xm|XM|iso|ISO)|+([0-9]).@(vdr|VDR))=3F(.@(crdownl?= =?UTF-8?q?oad|part))"=20[ps2pdfwr]=3D"!*.@(=3F(e)ps|pdf)"=20[dvitype]=3D"?= =?UTF-8?q?!*.dvi"=20[unpigz]=3D"!*.@(Z|[gGdz]z|t[ag]z)"=20[mozilla]=3D"!*?= =?UTF-8?q?.@(=3F([xX]|[sS])[hH][tT][mM]=3F([lL]))"=20[pdfunite]=3D"!*.pdf?= =?UTF-8?q?"=20[gpdf]=3D"!*.[pf]df"=20[texi2dvi]=3D"!*.@(=3F(la)tex|texi|d?= =?UTF-8?q?tx|ins|ltx|dbj)"=20[bunzip2]=3D"!*.=3F(t)bz=3F(2)"=20[zathura]?= =?UTF-8?q?=3D"!*.@(cb[rz7t]|djv=3F(u)|=3F(e)ps|pdf)"=20[kaffeine]=3D"!*@(?= =?UTF-8?q?.@(mp=3F(e)g|MP=3F(E)G|wm[av]|WM[AV]|avi|AVI|asf|vob|VOB|bin|da?= =?UTF-8?q?t|divx|DIVX|vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|rm|ram|yuv|mov|M?= =?UTF-8?q?OV|qt|QT|web[am]|WEB[AM]|mp[234]|MP[234]|m=3F(p)4[av]|M=3F(P)4[?= =?UTF-8?q?AV]|mkv|MKV|og[agmvx]|OG[AGMVX]|t[ps]|T[PS]|m2t=3F(s)|M2T=3F(S)?= =?UTF-8?q?|mts|MTS|wav|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[?= =?UTF-8?q?3t]m|S[3T]M|it|IT|xm|XM|iso|ISO)|+([0-9]).@(vdr|VDR))=3F(.@(crd?= =?UTF-8?q?ownload|part))"=20[mpg123]=3D"!*.mp3"=20[lzegrep]=3D"!*.@(tlz|l?= =?UTF-8?q?zma)"=20[xv]=3D"!*.@(gif|jp=3F(e)g=3F(2)|j2[ck]|jp[2f]|tif=3F(f?= =?UTF-8?q?)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm|=3F(e)ps)"=20[xdvi?= =?UTF-8?q?]=3D"!*.@(dvi|DVI)=3F(.@(gz|Z|bz2))"=20[xfig]=3D"!*.fig"=20[xpd?= =?UTF-8?q?f]=3D"!*.@(pdf|fdf)=3F(.@(gz|GZ|bz2|BZ2|Z))"=20[oobase]=3D"!*.o?= =?UTF-8?q?db"=20[xelatex]=3D"!*.@(=3F(la)tex|texi|dtx|ins|ltx|dbj)"=20[gh?= =?UTF-8?q?arbour]=3D"!*.@([Pp][Rr][Gg]|[Cc][Ll][Pp])"=20[bzcat]=3D"!*.=3F?= =?UTF-8?q?(t)bz=3F(2)"=20[dragon]=3D"!*@(.@(mp=3F(e)g|MP=3F(E)G|wm[av]|WM?= =?UTF-8?q?[AV]|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|F?= =?UTF-8?q?LV|fxm|FXM|viv|rm|ram|yuv|mov|MOV|qt|QT|web[am]|WEB[AM]|mp[234]?= =?UTF-8?q?|MP[234]|m=3F(p)4[av]|M=3F(P)4[AV]|mkv|MKV|og[agmvx]|OG[AGMVX]|?= =?UTF-8?q?t[ps]|T[PS]|m2t=3F(s)|M2T=3F(S)|mts|MTS|wav|WAV|flac|FLAC|asx|A?= =?UTF-8?q?SX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM|iso|ISO)?= =?UTF-8?q?|+([0-9]).@(vdr|VDR))=3F(.@(crdownload|part))"=20[xanim]=3D"!*.?= =?UTF-8?q?@(mpg|mpeg|avi|mov|qt)"=20[lualatex]=3D"!*.@(=3F(la)tex|texi|dt?= =?UTF-8?q?x|ins|ltx|dbj)"=20[rgview]=3D"*.@([ao]|so|so.!(conf|*/*)|[rs]pm?= =?UTF-8?q?|gif|jp=3F(e)g|mp3|mp=3F(e)g|avi|asf|ogg|class)"=20[rvim]=3D"*.?= =?UTF-8?q?@([ao]|so|so.!(conf|*/*)|[rs]pm|gif|jp=3F(e)g|mp3|mp=3F(e)g|avi?= =?UTF-8?q?|asf|ogg|class)"=20[xetex]=3D"!*.@(=3F(la)tex|texi|dtx|ins|ltx|?= =?UTF-8?q?dbj)"=20[lomath]=3D"!*.@(sxm|smf|mml|odf)"=20[zcat]=3D"!*.@(Z|[?= =?UTF-8?q?gGd]z|t[ag]z)"=20[lynx]=3D"!*.@(=3F([xX]|[sS])[hH][tT][mM]=3F([?= =?UTF-8?q?lL]))"=20[uncompress]=3D"!*.Z"=20[xzcat]=3D"!*.@(=3F(t)xz|tlz|l?= =?UTF-8?q?zma)"=20[vim]=3D"*.@([ao]|so|so.!(conf|*/*)|[rs]pm|gif|jp=3F(e)?= =?UTF-8?q?g|mp3|mp=3F(e)g|avi|asf|ogg|class)"=20[loimpress]=3D"!*.@(sxi|s?= =?UTF-8?q?ti|pps=3F(x)|ppt=3F([mx])|pot=3F([mx])|=3F(f)odp|otp)"=20[dvipd?= =?UTF-8?q?f]=3D"!*.dvi"=20[mpg321]=3D"!*.mp3"=20[jadetex]=3D"!*.@(=3F(la)?= =?UTF-8?q?tex|texi|dtx|ins|ltx|dbj)"=20[lobase]=3D"!*.odb"=20[epdfview]?= =?UTF-8?q?=3D"!*.pdf"=20[ps2pdf14]=3D"!*.@(=3F(e)ps|pdf)"=20[ps2pdf13]=3D?= =?UTF-8?q?"!*.@(=3F(e)ps|pdf)"=20[ps2pdf12]=3D"!*.@(=3F(e)ps|pdf)"=20[poe?= =?UTF-8?q?dit]=3D"!*.po"=20[luatex]=3D"!*.@(=3F(la)tex|texi|dtx|ins|ltx|d?= =?UTF-8?q?bj)"=20[kbabel]=3D"!*.po"=20[bzme]=3D"!*.@(zip|z|gz|tgz)"=20[dv?= =?UTF-8?q?iselect]=3D"!*.dvi"=20[realplay]=3D"!*.@(rm=3F(j)|ra=3F(m)|smi?= =?UTF-8?q?=3F(l))"=20[kdvi]=3D"!*.@(dvi|DVI)=3F(.@(gz|Z|bz2))"=20[elinks]?= =?UTF-8?q?=3D"!*.@(=3F([xX]|[sS])[hH][tT][mM]=3F([lL]))"=20[kghostview]?= =?UTF-8?q?=3D"!*.@(@(=3F(e)ps|=3F(E)PS|pdf|PDF)=3F(.gz|.GZ|.bz2|.BZ2|.Z))?= =?UTF-8?q?"=20[gtranslator]=3D"!*.po"=20[unzip]=3D"!*.@(zip|[aegjswx]ar|e?= =?UTF-8?q?xe|pk3|wsz|zargo|xpi|s[tx][cdiw]|sx[gm]|o[dt][tspgfc]|od[bm]|ox?= =?UTF-8?q?t|epub|apk|aab|ipa|do[ct][xm]|p[op]t[mx]|xl[st][xm]|pyz|whl|[Ff?= =?UTF-8?q?][Cc][Ss]td)"=20[ggv]=3D"!*.@(@(=3F(e)ps|=3F(E)PS|pdf|PDF)=3F(.?= =?UTF-8?q?gz|.GZ|.bz2|.BZ2|.Z))"=20[oomath]=3D"!*.@(sxm|smf|mml|odf)"=20[?= =?UTF-8?q?dvipdfmx]=3D"!*.dvi"=20[makeinfo]=3D"!*.texi*"=20[okular]=3D"!*?= =?UTF-8?q?.@(okular|@(=3F(e|x)ps|=3F(E|X)PS|[pf]df|[PF]DF|dvi|DVI|cb[rz]|?= =?UTF-8?q?CB[RZ]|djv=3F(u)|DJV=3F(U)|dvi|DVI|gif|jp=3F(e)g|miff|tif=3F(f)?= =?UTF-8?q?|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP=3F(E)G|MIFF|TIF?= =?UTF-8?q?=3F(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX|epub|EPUB|odt|ODT?= =?UTF-8?q?|fb=3F(2)|FB=3F(2)|mobi|MOBI|g3|G3|chm|CHM)=3F(.=3F(gz|GZ|bz2|B?= =?UTF-8?q?Z2|xz|XZ)))"=20[sxemacs]=3D"*.@([ao]|so|so.!(conf|*/*)|[rs]pm|g?= =?UTF-8?q?if|jp=3F(e)g|mp3|mp=3F(e)g|avi|asf|ogg|class)"=20[aviplay]=3D"!?= =?UTF-8?q?*.@(avi|asf|wmv)"=20[rgvim]=3D"*.@([ao]|so|so.!(conf|*/*)|[rs]p?= =?UTF-8?q?m|gif|jp=3F(e)g|mp3|mp=3F(e)g|avi|asf|ogg|class)"=20[dvipdfm]?= =?UTF-8?q?=3D"!*.dvi"=20[ly2dvi]=3D"!*.ly"=20[oodraw]=3D"!*.@(sxd|std|sda?= =?UTF-8?q?|sdd|=3F(f)odg|otg)"=20[kpdf]=3D"!*.@(=3F(e)ps|pdf)"=20[bibtex]?= =?UTF-8?q?=3D"!*.aux"=20[netscape]=3D"!*.@(=3F([xX]|[sS])[hH][tT][mM]=3F(?= =?UTF-8?q?[lL]))"=20[emacs]=3D"*.@([ao]|so|so.!(conf|*/*)|[rs]pm|gif|jp?= =?UTF-8?q?=3F(e)g|mp3|mp=3F(e)g|avi|asf|ogg|class)"=20[rview]=3D"*.@([ao]?= =?UTF-8?q?|so|so.!(conf|*/*)|[rs]pm|gif|jp=3F(e)g|mp3|mp=3F(e)g|avi|asf|o?= =?UTF-8?q?gg|class)"=20[galeon]=3D"!*.@(=3F([xX]|[sS])[hH][tT][mM]=3F([lL?= =?UTF-8?q?]))"=20[dillo]=3D"!*.@(=3F([xX]|[sS])[hH][tT][mM]=3F([lL]))"=20?= =?UTF-8?q?[fbxine]=3D"!*@(.@(mp=3F(e)g|MP=3F(E)G|wm[av]|WM[AV]|avi|AVI|as?= =?UTF-8?q?f|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|?= =?UTF-8?q?rm|ram|yuv|mov|MOV|qt|QT|web[am]|WEB[AM]|mp[234]|MP[234]|m=3F(p?= =?UTF-8?q?)4[av]|M=3F(P)4[AV]|mkv|MKV|og[agmvx]|OG[AGMVX]|t[ps]|T[PS]|m2t?= =?UTF-8?q?=3F(s)|M2T=3F(S)|mts|MTS|wav|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|?= =?UTF-8?q?m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM)|+([0-9]).@(vdr|VDR))?= =?UTF-8?q?=3F(.@(crdownload|part))"=20[oocalc]=3D"!*.@(sxc|stc|xls=3F([bm?= =?UTF-8?q?x])|xlw|xlt=3F([mx])|[ct]sv|=3F(f)ods|ots)"=20[harbour]=3D"!*.@?= =?UTF-8?q?([Pp][Rr][Gg]|[Cc][Ll][Pp])"=20[lodraw]=3D"!*.@(sxd|std|sda|sdd?= =?UTF-8?q?|=3F(f)odg|otg)"=20[dvips]=3D"!*.dvi"=20[ps2pdf]=3D"!*.@(=3F(e)?= =?UTF-8?q?ps|pdf)"=20[kate]=3D"*.@([ao]|so|so.!(conf|*/*)|[rs]pm|gif|jp?= =?UTF-8?q?=3F(e)g|mp3|mp=3F(e)g|avi|asf|ogg|class)"=20[kid3-qt]=3D"!*.@(m?= =?UTF-8?q?p[234c]|og[ag]|@(fl|a)ac|m4[abp]|spx|tta|w=3F(a)v|wma|aif=3F(f)?= =?UTF-8?q?|asf|ape)"=20[pdftex]=3D"!*.@(=3F(la)tex|texi|dtx|ins|ltx|dbj)"?= =?UTF-8?q?=20[gvim]=3D"*.@([ao]|so|so.!(conf|*/*)|[rs]pm|gif|jp=3F(e)g|mp?= =?UTF-8?q?3|mp=3F(e)g|avi|asf|ogg|class)"=20[timidity]=3D"!*.@(mid=3F(i)|?= =?UTF-8?q?rmi|rcp|[gr]36|g18|mod|xm|it|x3m|s[3t]m|kar)"=20[ogg123]=3D"!*.?= =?UTF-8?q?@(og[ag]|m3u|flac|spx)"=20[lzgrep]=3D"!*.@(tlz|lzma)"=20[ee]=3D?= =?UTF-8?q?"!*.@(gif|jp=3F(e)g|miff|tif=3F(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|x?= =?UTF-8?q?wd|tga|pcx)"=20[unlzma]=3D"!*.@(tlz|lzma)"=20[lbunzip2]=3D"!*.?= =?UTF-8?q?=3F(t)bz=3F(2)"=20[ooimpress]=3D"!*.@(sxi|sti|pps=3F(x)|ppt=3F(?= =?UTF-8?q?[mx])|pot=3F([mx])|=3F(f)odp|otp)"=20[xine]=3D"!*@(.@(mp=3F(e)g?= =?UTF-8?q?|MP=3F(E)G|wm[av]|WM[AV]|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|?= =?UTF-8?q?vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|rm|ram|yuv|mov|MOV|qt|QT|web?= =?UTF-8?q?[am]|WEB[AM]|mp[234]|MP[234]|m=3F(p)4[av]|M=3F(P)4[AV]|mkv|MKV|?= =?UTF-8?q?og[agmvx]|OG[AGMVX]|t[ps]|T[PS]|m2t=3F(s)|M2T=3F(S)|mts|MTS|wav?= =?UTF-8?q?|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|?= =?UTF-8?q?it|IT|xm|XM)|+([0-9]).@(vdr|VDR))=3F(.@(crdownload|part))"=20[a?= =?UTF-8?q?maya]=3D"!*.@(=3F([xX]|[sS])[hH][tT][mM]=3F([lL]))"=20[gv]=3D"!?= =?UTF-8?q?*.@(@(=3F(e)ps|=3F(E)PS|pdf|PDF)=3F(.gz|.GZ|.bz2|.BZ2|.Z))"=20[?= =?UTF-8?q?kid3]=3D"!*.@(mp[234c]|og[ag]|@(fl|a)ac|m4[abp]|spx|tta|w=3F(a)?= =?UTF-8?q?v|wma|aif=3F(f)|asf|ape)"=20[lilypond]=3D"!*.ly"=20[modplug123]?= =?UTF-8?q?=3D"!*.@(669|abc|am[fs]|d[bs]m|dmf|far|it|mdl|m[eo]d|mid=3F(i)|?= =?UTF-8?q?mt[2m]|oct|okt=3F(a)|p[st]m|s[3t]m|ult|umx|wav|xm)"=20[pbzcat]?= =?UTF-8?q?=3D"!*.=3F(t)bz=3F(2)"=20[unxz]=3D"!*.@(=3F(t)xz|tlz|lzma)"=20[?= =?UTF-8?q?playmidi]=3D"!*.@(mid=3F(i)|cmf)"=20[lzcat]=3D"!*.@(tlz|lzma)"?= =?UTF-8?q?=20[slitex]=3D"!*.@(=3F(la)tex|texi|dtx|ins|ltx|dbj)"=20[aaxine?= =?UTF-8?q?]=3D"!*@(.@(mp=3F(e)g|MP=3F(E)G|wm[av]|WM[AV]|avi|AVI|asf|vob|V?= =?UTF-8?q?OB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|rm|ram|?= =?UTF-8?q?yuv|mov|MOV|qt|QT|web[am]|WEB[AM]|mp[234]|MP[234]|m=3F(p)4[av]|?= =?UTF-8?q?M=3F(P)4[AV]|mkv|MKV|og[agmvx]|OG[AGMVX]|t[ps]|T[PS]|m2t=3F(s)|?= =?UTF-8?q?M2T=3F(S)|mts|MTS|wav|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|m[eo]d|?= =?UTF-8?q?M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM)|+([0-9]).@(vdr|VDR))=3F(.@(cr?= =?UTF-8?q?download|part))"=20[advi]=3D"!*.dvi"=20[lzmore]=3D"!*.@(tlz|lzm?= =?UTF-8?q?a)"=20)=20=5F=5Fexpand=5Ftilde=5Fby=5Fref=20()=20{=20=20=20=20?= =?UTF-8?q?=20if=20[[=20${!1-}=20=3D=3D=20\~*=20]];=20then=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20eval=20$1=3D"$(printf=20~%q=20"${!1#\~}")";=20=20?= =?UTF-8?q?=20=20=20fi=20}=20=5F=5Fget=5Fcword=5Fat=5Fcursor=5Fby=5Fref=20?= =?UTF-8?q?()=20{=20=20=20=20=20local=20cword=20words=3D();=20=20=20=20=20?= =?UTF-8?q?=5F=5Freassemble=5Fcomp=5Fwords=5Fby=5Fref=20"$1"=20words=20cwo?= =?UTF-8?q?rd;=20=20=20=20=20local=20i=20cur=3D""=20index=3D$COMP=5FPOINT?= =?UTF-8?q?=20lead=3D${COMP=5FLINE:0:COMP=5FPOINT};=20=20=20=20=20if=20[[?= =?UTF-8?q?=20$index=20-gt=200=20&&=20(=20-n=20$lead=20&&=20-n=20${lead//[?= =?UTF-8?q?[:space:]]/}=20)=20]];=20then=20=20=20=20=20=20=20=20=20cur=3D$?= =?UTF-8?q?COMP=5FLINE;=20=20=20=20=20=20=20=20=20for=20((i=20=3D=200;=20i?= =?UTF-8?q?=20<=3D=20cword;=20++i))=20=20=20=20=20=20=20=20=20do=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20while=20[[=20${#cur}=20-ge=20${#w?= =?UTF-8?q?ords[i]}=20&&=20${cur:0:${#words[i]}}=20!=3D=20"${words[i]-}"?= =?UTF-8?q?=20]];=20do=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20c?= =?UTF-8?q?ur=3D"${cur:1}";=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20((index=20>=200))=20&&=20((index--));=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20done;=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20if=20((i=20<=20cword));=20then=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20local=20old=5Fsize=3D${#cur};=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20cur=3D"${cur#"${words[i]?= =?UTF-8?q?}"}";=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20local?= =?UTF-8?q?=20new=5Fsize=3D${#cur};=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20((index=20-=3D=20old=5Fsize=20-=20new=5Fsize));=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20done;=20=20=20=20=20=20=20=20=20[[=20-n=20$cur=20&&=20!=20-n?= =?UTF-8?q?=20${cur//[[:space:]]/}=20]]=20&&=20cur=3D;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20((index=20<=200))=20&&=20index=3D0;=20=20=20=20=20fi;?= =?UTF-8?q?=20=20=20=20=20local=20"$2"=20"$3"=20"$4"=20&&=20=5Fupvars=20-a?= =?UTF-8?q?${#words[@]}=20$2=20${words+"${words[@]}"}=20-v=20$3=20"$cword"?= =?UTF-8?q?=20-v=20$4=20"${cur:0:index}"=20}=20=5F=5Fgit=5Feread=20()=20{?= =?UTF-8?q?=20=20=20=20=20test=20-r=20"$1"=20&&=20IFS=3D'=20'=20read=20-r?= =?UTF-8?q?=20"$2"=20<=20"$1"=20}=20=5F=5Fgit=5Fps1=20()=20{=20=20=20=20?= =?UTF-8?q?=20local=20exit=3D$=3F;=20=20=20=20=20local=20pcmode=3Dno;=20?= =?UTF-8?q?=20=20=20=20local=20detached=3Dno;=20=20=20=20=20local=20ps1pc?= =?UTF-8?q?=5Fstart=3D'\u@\h:\w=20';=20=20=20=20=20local=20ps1pc=5Fend=3D'?= =?UTF-8?q?\$=20';=20=20=20=20=20local=20printf=5Fformat=3D'=20(%s)';=20?= =?UTF-8?q?=20=20=20=20case=20"$#"=20in=20=20=20=20=20=20=20=20=202=20|=20?= =?UTF-8?q?3)=20=20=20=20=20=20=20=20=20=20=20=20=20pcmode=3Dyes;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20ps1pc=5Fstart=3D"$1";=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20ps1pc=5Fend=3D"$2";=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20printf=5Fformat=3D"${3:-$printf=5Fforma?= =?UTF-8?q?t}";=20=20=20=20=20=20=20=20=20=20=20=20=20PS1=3D"$ps1pc=5Fstar?= =?UTF-8?q?t$ps1pc=5Fend"=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=200=20|=201)=20=20=20=20=20=20=20=20=20=20=20=20=20print?= =?UTF-8?q?f=5Fformat=3D"${1:-$printf=5Fformat}"=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20;;=20=20=20=20=20=20=20=20=20*)=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20return=20$exit=20=20=20=20=20=20=20=20=20;;=20=20?= =?UTF-8?q?=20=20=20esac;=20=20=20=20=20local=20ps1=5Fexpanded=3Dyes;=20?= =?UTF-8?q?=20=20=20=20[=20-z=20"${ZSH=5FVERSION-}"=20]=20||=20[[=20-o=20P?= =?UTF-8?q?ROMPT=5FSUBST=20]]=20||=20ps1=5Fexpanded=3Dno;=20=20=20=20=20[?= =?UTF-8?q?=20-z=20"${BASH=5FVERSION-}"=20]=20||=20shopt=20-q=20promptvars?= =?UTF-8?q?=20||=20ps1=5Fexpanded=3Dno;=20=20=20=20=20local=20repo=5Finfo?= =?UTF-8?q?=20rev=5Fparse=5Fexit=5Fcode;=20=20=20=20=20repo=5Finfo=3D"$(gi?= =?UTF-8?q?t=20rev-parse=20--git-dir=20--is-inside-git-dir=20--is-bare-rep?= =?UTF-8?q?ository=20--is-inside-work-tree=20--short=20HEAD=202>=20/dev/nu?= =?UTF-8?q?ll)";=20=20=20=20=20rev=5Fparse=5Fexit=5Fcode=3D"$=3F";=20=20?= =?UTF-8?q?=20=20=20if=20[=20-z=20"$repo=5Finfo"=20];=20then=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20return=20$exit;=20=20=20=20=20fi;=20=20=20=20=20?= =?UTF-8?q?local=20short=5Fsha=3D"";=20=20=20=20=20if=20[=20"$rev=5Fparse?= =?UTF-8?q?=5Fexit=5Fcode"=20=3D=20"0"=20];=20then=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20short=5Fsha=3D"${repo=5Finfo##*'=20'}";=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20repo=5Finfo=3D"${repo=5Finfo%'=20'*}";=20=20=20=20=20fi;?= =?UTF-8?q?=20=20=20=20=20local=20inside=5Fworktree=3D"${repo=5Finfo##*'?= =?UTF-8?q?=20'}";=20=20=20=20=20repo=5Finfo=3D"${repo=5Finfo%'=20'*}";=20?= =?UTF-8?q?=20=20=20=20local=20bare=5Frepo=3D"${repo=5Finfo##*'=20'}";=20?= =?UTF-8?q?=20=20=20=20repo=5Finfo=3D"${repo=5Finfo%'=20'*}";=20=20=20=20?= =?UTF-8?q?=20local=20inside=5Fgitdir=3D"${repo=5Finfo##*'=20'}";=20=20=20?= =?UTF-8?q?=20=20local=20g=3D"${repo=5Finfo%'=20'*}";=20=20=20=20=20if=20[?= =?UTF-8?q?=20"true"=20=3D=20"$inside=5Fworktree"=20]=20&&=20[=20-n=20"${G?= =?UTF-8?q?IT=5FPS1=5FHIDE=5FIF=5FPWD=5FIGNORED-}"=20]=20&&=20[=20"$(git?= =?UTF-8?q?=20config=20--bool=20bash.hideIfPwdIgnored)"=20!=3D=20"false"?= =?UTF-8?q?=20]=20&&=20git=20check-ignore=20-q=20.;=20then=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20return=20$exit;=20=20=20=20=20fi;=20=20=20=20=20loc?= =?UTF-8?q?al=20sparse=3D"";=20=20=20=20=20if=20[=20-z=20"${GIT=5FPS1=5FCO?= =?UTF-8?q?MPRESSSPARSESTATE-}"=20]=20&&=20[=20-z=20"${GIT=5FPS1=5FOMITSPA?= =?UTF-8?q?RSESTATE-}"=20]=20&&=20[=20"$(git=20config=20--bool=20core.spar?= =?UTF-8?q?seCheckout)"=20=3D=20"true"=20];=20then=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20sparse=3D"|SPARSE";=20=20=20=20=20fi;=20=20=20=20=20local=20?= =?UTF-8?q?r=3D"";=20=20=20=20=20local=20b=3D"";=20=20=20=20=20local=20ste?= =?UTF-8?q?p=3D"";=20=20=20=20=20local=20total=3D"";=20=20=20=20=20if=20[?= =?UTF-8?q?=20-d=20"$g/rebase-merge"=20];=20then=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=5F=5Fgit=5Feread=20"$g/rebase-merge/head-name"=20b;=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=5F=5Fgit=5Feread=20"$g/rebase-merge/msgnu?= =?UTF-8?q?m"=20step;=20=20=20=20=20=20=20=20=20=5F=5Fgit=5Feread=20"$g/re?= =?UTF-8?q?base-merge/end"=20total;=20=20=20=20=20=20=20=20=20r=3D"|REBASE?= =?UTF-8?q?";=20=20=20=20=20else=20=20=20=20=20=20=20=20=20if=20[=20-d=20"?= =?UTF-8?q?$g/rebase-apply"=20];=20then=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=5F=5Fgit=5Feread=20"$g/rebase-apply/next"=20step;=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=5F=5Fgit=5Feread=20"$g/rebase?= =?UTF-8?q?-apply/last"=20total;=20=20=20=20=20=20=20=20=20=20=20=20=20if?= =?UTF-8?q?=20[=20-f=20"$g/rebase-apply/rebasing"=20];=20then=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=5F=5Fgit=5Feread=20"$g/?= =?UTF-8?q?rebase-apply/head-name"=20b;=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20r=3D"|REBASE";=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20if=20[=20-f=20"$g/rebase-apply/applying"=20];=20then=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20r=3D"|?= =?UTF-8?q?AM";=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20else=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20r?= =?UTF-8?q?=3D"|AM/REBASE";=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20fi;=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20=20if=20?= =?UTF-8?q?[=20-f=20"$g/MERGE=5FHEAD"=20];=20then=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20r=3D"|MERGING";=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20if=20=5F=5Fgit=5Fsequencer=5Fstatus;=20then=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20:;=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20else=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20if=20[=20?= =?UTF-8?q?-f=20"$g/BISECT=5FLOG"=20];=20then=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20r=3D"|BISECTING?= =?UTF-8?q?";=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20fi;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20fi;=20=20=20=20=20=20=20=20=20if=20[=20-n=20"$b"=20];=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20:;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20else=20=20=20=20=20=20=20=20=20=20=20=20=20if=20[=20-h=20?= =?UTF-8?q?"$g/HEAD"=20];=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20b=3D"$(git=20symbolic-ref=20HEAD=202>=20/dev/null)";?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20local=20head=3D"";=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20if=20!=20=5F=5Fgit=5Fere?= =?UTF-8?q?ad=20"$g/HEAD"=20head;=20then=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20return=20$exit;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20b=3D"${head#ref:=20}";=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20if=20[=20"$head"=20=3D=20"$?= =?UTF-8?q?b"=20];=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20detached=3Dyes;=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20b=3D"$(case=20"${GIT=5FPS1=5FDESC?= =?UTF-8?q?RIBE=5FSTYLE-}"=20in=20=20=20=20=20contains)=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20git=20describe=20--contains=20HEAD=20=20=20=20=20;;=20?= =?UTF-8?q?=20=20=20=20branch)=20=20=20=20=20=20=20=20=20git=20describe=20?= =?UTF-8?q?--contains=20--all=20HEAD=20=20=20=20=20;;=20=20=20=20=20tag)?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20git=20describe=20--tags=20HEAD=20=20?= =?UTF-8?q?=20=20=20;;=20=20=20=20=20describe)=20=20=20=20=20=20=20=20=20g?= =?UTF-8?q?it=20describe=20HEAD=20=20=20=20=20;;=20=20=20=20=20*=20|=20def?= =?UTF-8?q?ault)=20=20=20=20=20=20=20=20=20git=20describe=20--tags=20--exa?= =?UTF-8?q?ct-match=20HEAD=20=20=20=20=20;;=20esac=202>=20/dev/null)"=20||?= =?UTF-8?q?=20b=3D"$short=5Fsha...";=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20b=3D"($b)";=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20fi;=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20fi;=20=20?= =?UTF-8?q?=20=20=20if=20[=20-n=20"$step"=20]=20&&=20[=20-n=20"$total"=20]?= =?UTF-8?q?;=20then=20=20=20=20=20=20=20=20=20r=3D"$r=20$step/$total";=20?= =?UTF-8?q?=20=20=20=20fi;=20=20=20=20=20local=20conflict=3D"";=20=20=20?= =?UTF-8?q?=20=20if=20[[=20"${GIT=5FPS1=5FSHOWCONFLICTSTATE}"=20=3D=3D=20"?= =?UTF-8?q?yes"=20]]=20&&=20[[=20-n=20$(git=20ls-files=20--unmerged=202>?= =?UTF-8?q?=20/dev/null)=20]];=20then=20=20=20=20=20=20=20=20=20conflict?= =?UTF-8?q?=3D"|CONFLICT";=20=20=20=20=20fi;=20=20=20=20=20local=20w=3D"";?= =?UTF-8?q?=20=20=20=20=20local=20i=3D"";=20=20=20=20=20local=20s=3D"";=20?= =?UTF-8?q?=20=20=20=20local=20u=3D"";=20=20=20=20=20local=20h=3D"";=20=20?= =?UTF-8?q?=20=20=20local=20c=3D"";=20=20=20=20=20local=20p=3D"";=20=20=20?= =?UTF-8?q?=20=20local=20upstream=3D"";=20=20=20=20=20if=20[=20"true"=20?= =?UTF-8?q?=3D=20"$inside=5Fgitdir"=20];=20then=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?if=20[=20"true"=20=3D=20"$bare=5Frepo"=20];=20then=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20c=3D"BARE:";=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20else=20=20=20=20=20=20=20=20=20=20=20=20=20b=3D"GIT=5FDIR!";?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20else=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20if=20[=20"true"=20=3D=20"$inside=5Fworktree"=20]?= =?UTF-8?q?;=20then=20=20=20=20=20=20=20=20=20=20=20=20=20if=20[=20-n=20"$?= =?UTF-8?q?{GIT=5FPS1=5FSHOWDIRTYSTATE-}"=20]=20&&=20[=20"$(git=20config?= =?UTF-8?q?=20--bool=20bash.showDirtyState)"=20!=3D=20"false"=20];=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20git=20diff?= =?UTF-8?q?=20--no-ext-diff=20--quiet=20||=20w=3D"*";=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20git=20diff=20--no-ext-diff=20--ca?= =?UTF-8?q?ched=20--quiet=20||=20i=3D"+";=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20if=20[=20-z=20"$short=5Fsha"=20]=20&&=20[=20-?= =?UTF-8?q?z=20"$i"=20];=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20i=3D"#";=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20=20=20=20=20fi;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20if=20[=20-n=20"${GIT=5FP?= =?UTF-8?q?S1=5FSHOWSTASHSTATE-}"=20]=20&&=20git=20rev-parse=20--verify=20?= =?UTF-8?q?--quiet=20refs/stash=20>=20/dev/null;=20then=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20s=3D"$";=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20=20=20=20=20if?= =?UTF-8?q?=20[=20-n=20"${GIT=5FPS1=5FSHOWUNTRACKEDFILES-}"=20]=20&&=20[?= =?UTF-8?q?=20"$(git=20config=20--bool=20bash.showUntrackedFiles)"=20!=3D?= =?UTF-8?q?=20"false"=20]=20&&=20git=20ls-files=20--others=20--exclude-sta?= =?UTF-8?q?ndard=20--directory=20--no-empty-directory=20--error-unmatch=20?= =?UTF-8?q?--=20':/*'=20>=20/dev/null=202>=20/dev/null;=20then=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20u=3D"%${ZSH=5FVERSION+%}?= =?UTF-8?q?";=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20if=20[=20-n=20"${GIT=5FPS1=5FCOMPRESSSPARS?= =?UTF-8?q?ESTATE-}"=20]=20&&=20[=20"$(git=20config=20--bool=20core.sparse?= =?UTF-8?q?Checkout)"=20=3D=20"true"=20];=20then=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20h=3D"=3F";=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20=20=20=20=20if=20[?= =?UTF-8?q?=20-n=20"${GIT=5FPS1=5FSHOWUPSTREAM-}"=20];=20then=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=5F=5Fgit=5Fps1=5Fshow?= =?UTF-8?q?=5Fupstream;=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20fi;=20=20=20=20=20fi;=20=20=20=20=20local=20z?= =?UTF-8?q?=3D"${GIT=5FPS1=5FSTATESEPARATOR-"=20"}";=20=20=20=20=20b=3D${b?= =?UTF-8?q?##refs/heads/};=20=20=20=20=20if=20[=20$pcmode=20=3D=20yes=20]?= =?UTF-8?q?=20&&=20[=20$ps1=5Fexpanded=20=3D=20yes=20];=20then=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=5F=5Fgit=5Fps1=5Fbranch=5Fname=3D$b;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20b=3D"\${=5F=5Fgit=5Fps1=5Fbranch=5Fname}";=20?= =?UTF-8?q?=20=20=20=20fi;=20=20=20=20=20if=20[=20-n=20"${GIT=5FPS1=5FSHOW?= =?UTF-8?q?COLORHINTS-}"=20];=20then=20=20=20=20=20=20=20=20=20=5F=5Fgit?= =?UTF-8?q?=5Fps1=5Fcolorize=5Fgitstring;=20=20=20=20=20fi;=20=20=20=20=20?= =?UTF-8?q?local=20f=3D"$h$w$i$s$u$p";=20=20=20=20=20local=20gitstring=3D"?= =?UTF-8?q?$c$b${f:+$z$f}${sparse}$r${upstream}${conflict}";=20=20=20=20?= =?UTF-8?q?=20if=20[=20$pcmode=20=3D=20yes=20];=20then=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20if=20[=20"${=5F=5Fgit=5Fprintf=5Fsupports=5Fv-}"=20!?= =?UTF-8?q?=3D=20yes=20];=20then=20=20=20=20=20=20=20=20=20=20=20=20=20git?= =?UTF-8?q?string=3D$(printf=20--=20"$printf=5Fformat"=20"$gitstring");=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20printf=20-v=20gitstring=20--=20"$printf=5Fformat"=20"$git?= =?UTF-8?q?string";=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20PS1=3D"$ps1pc=5Fstart$gitstring$ps1pc=5Fend";=20=20=20=20=20?= =?UTF-8?q?else=20=20=20=20=20=20=20=20=20printf=20--=20"$printf=5Fformat"?= =?UTF-8?q?=20"$gitstring";=20=20=20=20=20fi;=20=20=20=20=20return=20$exit?= =?UTF-8?q?=20}=20=5F=5Fgit=5Fps1=5Fcolorize=5Fgitstring=20()=20{=20=20=20?= =?UTF-8?q?=20=20if=20[[=20-n=20${ZSH=5FVERSION-}=20]];=20then=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20local=20c=5Fred=3D'%F{red}';=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20local=20c=5Fgreen=3D'%F{green}';=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20local=20c=5Flblue=3D'%F{blue}';=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20local=20c=5Fclear=3D'%f';=20=20=20=20=20else=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20local=20c=5Fred=3D'=01=1B[31m=02';=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20local=20c=5Fgreen=3D'=01=1B[32m=02';=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20local=20c=5Flblue=3D'=01=1B[1;34m=02';=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20local=20c=5Fclear=3D'=01=1B[0m=02';=20=20=20=20?= =?UTF-8?q?=20fi;=20=20=20=20=20local=20bad=5Fcolor=3D$c=5Fred;=20=20=20?= =?UTF-8?q?=20=20local=20ok=5Fcolor=3D$c=5Fgreen;=20=20=20=20=20local=20fl?= =?UTF-8?q?ags=5Fcolor=3D"$c=5Flblue";=20=20=20=20=20local=20branch=5Fcolo?= =?UTF-8?q?r=3D"";=20=20=20=20=20if=20[=20$detached=20=3D=20no=20];=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20branch=5Fcolor=3D"$ok=5Fcolor";=20?= =?UTF-8?q?=20=20=20=20else=20=20=20=20=20=20=20=20=20branch=5Fcolor=3D"$b?= =?UTF-8?q?ad=5Fcolor";=20=20=20=20=20fi;=20=20=20=20=20if=20[=20-n=20"$c"?= =?UTF-8?q?=20];=20then=20=20=20=20=20=20=20=20=20c=3D"$branch=5Fcolor$c$c?= =?UTF-8?q?=5Fclear";=20=20=20=20=20fi;=20=20=20=20=20b=3D"$branch=5Fcolor?= =?UTF-8?q?$b$c=5Fclear";=20=20=20=20=20if=20[=20-n=20"$w"=20];=20then=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20w=3D"$bad=5Fcolor$w$c=5Fclear";=20=20?= =?UTF-8?q?=20=20=20fi;=20=20=20=20=20if=20[=20-n=20"$i"=20];=20then=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20i=3D"$ok=5Fcolor$i$c=5Fclear";=20=20=20=20?= =?UTF-8?q?=20fi;=20=20=20=20=20if=20[=20-n=20"$s"=20];=20then=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20s=3D"$flags=5Fcolor$s$c=5Fclear";=20=20=20=20=20?= =?UTF-8?q?fi;=20=20=20=20=20if=20[=20-n=20"$u"=20];=20then=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20u=3D"$bad=5Fcolor$u$c=5Fclear";=20=20=20=20=20fi=20?= =?UTF-8?q?}=20=5F=5Fgit=5Fps1=5Fshow=5Fupstream=20()=20{=20=20=20=20=20lo?= =?UTF-8?q?cal=20key=20value;=20=20=20=20=20local=20svn=5Fremote=20svn=5Fu?= =?UTF-8?q?rl=5Fpattern=20count=20n;=20=20=20=20=20local=20upstream=5Ftype?= =?UTF-8?q?=3Dgit=20legacy=3D""=20verbose=3D""=20name=3D"";=20=20=20=20=20?= =?UTF-8?q?svn=5Fremote=3D();=20=20=20=20=20local=20output=3D"$(git=20conf?= =?UTF-8?q?ig=20-z=20--get-regexp=20'^(svn-remote\..*\.url|bash\.showupstr?= =?UTF-8?q?eam)$'=202>=20/dev/null=20|=20tr=20'\0\n'=20'\n=20')";=20=20=20?= =?UTF-8?q?=20=20while=20read=20-r=20key=20value;=20do=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20case=20"$key"=20in=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20bash.showupstream)=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20GIT=5FPS1=5FSHOWUPSTREAM=3D"$value";=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20if=20[[=20-z=20"${GIT=5FPS1=5F?= =?UTF-8?q?SHOWUPSTREAM}"=20]];=20then=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20p=3D"";=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20return;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20fi=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20svn-remote?= =?UTF-8?q?.*.url)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20svn?= =?UTF-8?q?=5Fremote[$((${#svn=5Fremote[@]}=20+=201))]=3D"$value";=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20svn=5Furl=5Fpatter?= =?UTF-8?q?n=3D"$svn=5Furl=5Fpattern\\|$value";=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20upstream=5Ftype=3Dsvn+git=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20esac;?= =?UTF-8?q?=20=20=20=20=20done=20<<<=20"$output";=20=20=20=20=20local=20op?= =?UTF-8?q?tion;=20=20=20=20=20for=20option=20in=20${GIT=5FPS1=5FSHOWUPSTR?= =?UTF-8?q?EAM};=20=20=20=20=20do=20=20=20=20=20=20=20=20=20case=20"$optio?= =?UTF-8?q?n"=20in=20=20=20=20=20=20=20=20=20=20=20=20=20git=20|=20svn)=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20upstream=5Ftype?= =?UTF-8?q?=3D"$option"=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20verbose)=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20verbose=3D1=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20legacy)?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20legacy=3D1?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20name)=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20name=3D1=20=20=20=20=20=20=20=20=20=20=20=20=20;;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20esac;=20=20=20=20=20done;=20=20=20?= =?UTF-8?q?=20=20case=20"$upstream=5Ftype"=20in=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?git)=20=20=20=20=20=20=20=20=20=20=20=20=20upstream=5Ftype=3D"@?= =?UTF-8?q?{upstream}"=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20svn*)=20=20=20=20=20=20=20=20=20=20=20=20=20local=20-a=20?= =?UTF-8?q?svn=5Fupstream;=20=20=20=20=20=20=20=20=20=20=20=20=20svn=5Fups?= =?UTF-8?q?tream=3D($(git=20log=20--first-parent=20-1=20--grep=3D"^git-svn?= =?UTF-8?q?-id:=20\(${svn=5Furl=5Fpattern#=3F=3F}\)"=202>=20/dev/null));?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20if=20[[=200=20-ne=20${#s?= =?UTF-8?q?vn=5Fupstream[@]}=20]];=20then=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20svn=5Fupstream=3D${svn=5Fupstream[${#svn=5Fup?= =?UTF-8?q?stream[@]}=20-=202]};=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20svn=5Fupstream=3D${svn=5Fupstream%@*};=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20local=20n=5Fstop=3D"${#svn?= =?UTF-8?q?=5Fremote[@]}";=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20for=20((n=3D1;=20n=20<=3D=20n=5Fstop;=20n++))=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20do=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20svn=5Fupstream=3D${svn?= =?UTF-8?q?=5Fupstream#${svn=5Fremote[$n]}};=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20done;=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20if=20[[=20-z=20"$svn=5Fupstream"=20]];=20then=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ups?= =?UTF-8?q?tream=5Ftype=3D${GIT=5FSVN=5FID:-git-svn};=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20upstream=5Ftype=3D${svn=5Fu?= =?UTF-8?q?pstream#/};=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20f?= =?UTF-8?q?i;=20=20=20=20=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20if=20[[=20"svn+git"=20=3D=20"$?= =?UTF-8?q?upstream=5Ftype"=20]];=20then=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20upstream=5Ftype=3D"@{upstream}";?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20fi=20=20=20=20=20=20=20=20=20;;?= =?UTF-8?q?=20=20=20=20=20esac;=20=20=20=20=20if=20[[=20-z=20"$legacy"=20]?= =?UTF-8?q?];=20then=20=20=20=20=20=20=20=20=20count=3D"$(git=20rev-list?= =?UTF-8?q?=20--count=20--left-right=20"$upstream=5Ftype"...HEAD=202>=20/d?= =?UTF-8?q?ev/null)";=20=20=20=20=20else=20=20=20=20=20=20=20=20=20local?= =?UTF-8?q?=20commits;=20=20=20=20=20=20=20=20=20if=20commits=3D"$(git=20r?= =?UTF-8?q?ev-list=20--left-right=20"$upstream=5Ftype"...HEAD=202>=20/dev/?= =?UTF-8?q?null)";=20then=20=20=20=20=20=20=20=20=20=20=20=20=20local=20co?= =?UTF-8?q?mmit=20behind=3D0=20ahead=3D0;=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20for=20commit=20in=20$commits;=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20do=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20case=20"$commit"=20in=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20"<"*)=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20((behind++))=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20*)=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20((ahead++))=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20esac;=20=20=20=20=20=20=20=20=20=20=20=20=20done;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20count=3D"$behind=09$ahea?= =?UTF-8?q?d";=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20count=3D"";=20=20=20=20=20=20=20=20=20fi;=20=20=20?= =?UTF-8?q?=20=20fi;=20=20=20=20=20if=20[[=20-z=20"$verbose"=20]];=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20case=20"$count"=20in=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20"")=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20p=3D""=20=20=20=20=20=20=20=20=20=20=20=20=20;;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20"0=090")=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20p=3D"=3D"=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20"?= =?UTF-8?q?0=09"*)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20p=3D"?= =?UTF-8?q?>"=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20*"=090")=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20p=3D"<"=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20*)=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20p=3D"<>"=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20esac;=20=20?= =?UTF-8?q?=20=20=20else=20=20=20=20=20=20=20=20=20case=20"$count"=20in=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20"")=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20upstream=3D""=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20"0?= =?UTF-8?q?=090")=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20upstre?= =?UTF-8?q?am=3D"|u=3D"=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20"0=09"*)=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20upstream=3D"|u+${count#0=09}"=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20*"=090")=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20upstream=3D"|u-${count%=090}"=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20*)=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20upstream=3D"|u+?= =?UTF-8?q?${count#*=09}-${count%=09*}"=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20;;=20=20=20=20=20=20=20=20=20esac;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20if=20[[=20-n=20"$count"=20&&=20-n=20"$name"=20]];=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=5F=5Fgit=5Fps1=5Fupstre?= =?UTF-8?q?am=5Fname=3D$(git=20rev-parse=20--abbrev-ref=20"$upstream=5Ftyp?= =?UTF-8?q?e"=202>=20/dev/null);=20=20=20=20=20=20=20=20=20=20=20=20=20if?= =?UTF-8?q?=20[=20$pcmode=20=3D=20yes=20]=20&&=20[=20$ps1=5Fexpanded=20=3D?= =?UTF-8?q?=20yes=20];=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20upstream=3D"$upstream=20\${=5F=5Fgit=5Fps1=5Fupstream=5Fn?= =?UTF-8?q?ame}";=20=20=20=20=20=20=20=20=20=20=20=20=20else=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20upstream=3D"$upstream=20?= =?UTF-8?q?${=5F=5Fgit=5Fps1=5Fupstream=5Fname}";=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20unset=20=5F=5Fgit=5Fps1=5Fupstream?= =?UTF-8?q?=5Fname;=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20fi=20}=20=5F=5Fgit=5Fsequencer?= =?UTF-8?q?=5Fstatus=20()=20{=20=20=20=20=20local=20todo;=20=20=20=20=20if?= =?UTF-8?q?=20test=20-f=20"$g/CHERRY=5FPICK=5FHEAD";=20then=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20r=3D"|CHERRY-PICKING";=20=20=20=20=20=20=20=20=20re?= =?UTF-8?q?turn=200;=20=20=20=20=20else=20=20=20=20=20=20=20=20=20if=20tes?= =?UTF-8?q?t=20-f=20"$g/REVERT=5FHEAD";=20then=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20r=3D"|REVERTING";=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20return=200;=20=20=20=20=20=20=20=20=20else=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20if=20=5F=5Fgit=5Feread=20"$g/sequencer/?= =?UTF-8?q?todo"=20todo;=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20case=20"$todo"=20in=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20p[\=20\=09]=20|=20pick[\=20\=09]*?= =?UTF-8?q?)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20r=3D"|CHERRY-PICKING";=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20return=200?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?;;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20revert[\=20\=09]*)=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20r=3D"|REVERTING";=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?return=200=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20esac;=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20fi;=20=20=20=20=20return=201?= =?UTF-8?q?=20}=20=5F=5Fload=5Fcompletion=20()=20{=20=20=20=20=20local=20-?= =?UTF-8?q?a=20dirs=3D(${BASH=5FCOMPLETION=5FUSER=5FDIR:-${XDG=5FDATA=5FHO?= =?UTF-8?q?ME:-$HOME/.local/share}/bash-completion}/completions);=20=20=20?= =?UTF-8?q?=20=20local=20ifs=3D$IFS=20IFS=3D:=20dir=20cmd=3D"${1##*/}"=20c?= =?UTF-8?q?ompfile;=20=20=20=20=20[[=20-n=20$cmd=20]]=20||=20return=201;?= =?UTF-8?q?=20=20=20=20=20for=20dir=20in=20${XDG=5FDATA=5FDIRS:-/usr/local?= =?UTF-8?q?/share:/usr/share};=20=20=20=20=20do=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?dirs+=3D($dir/bash-completion/completions);=20=20=20=20=20done;?= =?UTF-8?q?=20=20=20=20=20IFS=3D$ifs;=20=20=20=20=20if=20[[=20$BASH=5FSOUR?= =?UTF-8?q?CE=20=3D=3D=20*/*=20]];=20then=20=20=20=20=20=20=20=20=20dirs+?= =?UTF-8?q?=3D("${BASH=5FSOURCE%/*}/completions");=20=20=20=20=20else=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20dirs+=3D(./completions);=20=20=20=20=20?= =?UTF-8?q?fi;=20=20=20=20=20local=20backslash=3D;=20=20=20=20=20if=20[[?= =?UTF-8?q?=20$cmd=20=3D=3D=20\\*=20]];=20then=20=20=20=20=20=20=20=20=20c?= =?UTF-8?q?md=3D"${cmd:1}";=20=20=20=20=20=20=20=20=20$(complete=20-p=20"$?= =?UTF-8?q?cmd"=202>=20/dev/null=20||=20echo=20false)=20"\\$cmd"=20&&=20re?= =?UTF-8?q?turn=200;=20=20=20=20=20=20=20=20=20backslash=3D\\;=20=20=20=20?= =?UTF-8?q?=20fi;=20=20=20=20=20for=20dir=20in=20"${dirs[@]}";=20=20=20=20?= =?UTF-8?q?=20do=20=20=20=20=20=20=20=20=20[[=20-d=20$dir=20]]=20||=20cont?= =?UTF-8?q?inue;=20=20=20=20=20=20=20=20=20for=20compfile=20in=20"$cmd"=20?= =?UTF-8?q?"$cmd.bash"=20"=5F$cmd";=20=20=20=20=20=20=20=20=20do=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20compfile=3D"$dir/$compfile";=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20if=20[[=20-f=20$compfile=20?= =?UTF-8?q?]]=20&&=20.=20"$compfile"=20&>=20/dev/null;=20then=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20[[=20-n=20$backslash=20]?= =?UTF-8?q?]=20&&=20$(complete=20-p=20"$cmd")=20"\\$cmd";=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20return=200;=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20done;=20?= =?UTF-8?q?=20=20=20=20done;=20=20=20=20=20[[=20-v=20=5Fxspecs[$cmd]=20]]?= =?UTF-8?q?=20&&=20complete=20-F=20=5Ffiledir=5Fxspec=20"$cmd"=20"$backsla?= =?UTF-8?q?sh$cmd"=20&&=20return=200;=20=20=20=20=20return=201=20}=20=5F?= =?UTF-8?q?=5Fltrim=5Fcolon=5Fcompletions=20()=20{=20=20=20=20=20if=20[[?= =?UTF-8?q?=20$1=20=3D=3D=20*:*=20&&=20$COMP=5FWORDBREAKS=20=3D=3D=20*:*?= =?UTF-8?q?=20]];=20then=20=20=20=20=20=20=20=20=20local=20colon=5Fword=3D?= =?UTF-8?q?${1%"${1##*:}"};=20=20=20=20=20=20=20=20=20local=20i=3D${#COMPR?= =?UTF-8?q?EPLY[*]};=20=20=20=20=20=20=20=20=20while=20((i--=20>=200));=20?= =?UTF-8?q?do=20=20=20=20=20=20=20=20=20=20=20=20=20COMPREPLY[i]=3D${COMPR?= =?UTF-8?q?EPLY[i]#"$colon=5Fword"};=20=20=20=20=20=20=20=20=20done;=20=20?= =?UTF-8?q?=20=20=20fi=20}=20=5F=5Fparse=5Foptions=20()=20{=20=20=20=20=20?= =?UTF-8?q?local=20option=20option2=20i=20IFS=3D'=20,/|';=20=20=20=20=20op?= =?UTF-8?q?tion=3D;=20=20=20=20=20local=20-a=20array=3D($1);=20=20=20=20?= =?UTF-8?q?=20for=20i=20in=20"${array[@]}";=20=20=20=20=20do=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20case=20"$i"=20in=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20---*)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20break=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20--=3F*)=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20option=3D$i;=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20break=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20-=3F*)=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20[[=20-n=20$option=20]?= =?UTF-8?q?]=20||=20option=3D$i=20=20=20=20=20=20=20=20=20=20=20=20=20;;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20*)=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20break=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20;;=20=20=20=20=20=20=20=20=20esac;=20=20=20=20=20do?= =?UTF-8?q?ne;=20=20=20=20=20[[=20-n=20$option=20]]=20||=20return=200;=20?= =?UTF-8?q?=20=20=20=20IFS=3D'=20';=20=20=20=20=20if=20[[=20$option=20=3D~?= =?UTF-8?q?=20(\[((no|dont)-=3F)\]).=20]];=20then=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20option2=3D${option/"${BASH=5FREMATCH[1]}"/};=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20option2=3D${option2%%[<{().[]*};=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20printf=20'%s\n'=20"${option2/=3D*/=3D}";=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20option=3D${option/"${BASH=5FREMATCH[1]}"/"${BASH?= =?UTF-8?q?=5FREMATCH[2]}"};=20=20=20=20=20fi;=20=20=20=20=20option=3D${op?= =?UTF-8?q?tion%%[<{().[]*};=20=20=20=20=20printf=20'%s\n'=20"${option/=3D?= =?UTF-8?q?*/=3D}"=20}=20=5F=5Freassemble=5Fcomp=5Fwords=5Fby=5Fref=20()?= =?UTF-8?q?=20{=20=20=20=20=20local=20exclude=20i=20j=20line=20ref;=20=20?= =?UTF-8?q?=20=20=20if=20[[=20-n=20$1=20]];=20then=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20exclude=3D"[${1//[^$COMP=5FWORDBREAKS]/}]";=20=20=20=20=20fi?= =?UTF-8?q?;=20=20=20=20=20printf=20-v=20"$3"=20%s=20"$COMP=5FCWORD";=20?= =?UTF-8?q?=20=20=20=20if=20[[=20-v=20exclude=20]];=20then=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20line=3D$COMP=5FLINE;=20=20=20=20=20=20=20=20=20for?= =?UTF-8?q?=20((i=20=3D=200,=20j=20=3D=200;=20i=20<=20${#COMP=5FWORDS[@]};?= =?UTF-8?q?=20i++,=20j++))=20=20=20=20=20=20=20=20=20do=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20while=20[[=20$i=20-gt=200=20&&=20${COMP=5F?= =?UTF-8?q?WORDS[i]}=20=3D=3D=20+($exclude)=20]];=20do=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20[[=20$line=20!=3D=20[[:blank:]?= =?UTF-8?q?]*=20]]=20&&=20((j=20>=3D=202))=20&&=20((j--));=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20ref=3D"$2[$j]";=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20printf=20-v=20"$ref"=20%?= =?UTF-8?q?s=20"${!ref-}${COMP=5FWORDS[i]}";=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20((i=20=3D=3D=20COMP=5FCWORD))=20&&=20print?= =?UTF-8?q?f=20-v=20"$3"=20%s=20"$j";=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20line=3D${line#*"${COMP=5FWORDS[i]}"};=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20[[=20$line=20=3D=3D?= =?UTF-8?q?=20[[:blank:]]*=20]]=20&&=20((j++));=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20((i=20<=20${#COMP=5FWORDS[@]}=20-=201))?= =?UTF-8?q?=20&&=20((i++))=20||=20break=202;=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20done;=20=20=20=20=20=20=20=20=20=20=20=20=20ref=3D"$2[?= =?UTF-8?q?$j]";=20=20=20=20=20=20=20=20=20=20=20=20=20printf=20-v=20"$ref?= =?UTF-8?q?"=20%s=20"${!ref-}${COMP=5FWORDS[i]}";=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20line=3D${line#*"${COMP=5FWORDS[i]}"};=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20((i=20=3D=3D=20COMP=5FCWORD))=20&?= =?UTF-8?q?&=20printf=20-v=20"$3"=20%s=20"$j";=20=20=20=20=20=20=20=20=20d?= =?UTF-8?q?one;=20=20=20=20=20=20=20=20=20((i=20=3D=3D=20COMP=5FCWORD))=20?= =?UTF-8?q?&&=20printf=20-v=20"$3"=20%s=20"$j";=20=20=20=20=20else=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20for=20i=20in=20"${!COMP=5FWORDS[@]}";=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20do=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20printf=20-v=20"$2[i]"=20%s=20"${COMP=5FWORDS[i]}";=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20done;=20=20=20=20=20fi=20}=20=5Fallowed=5Fgro?= =?UTF-8?q?ups=20()=20{=20=20=20=20=20if=20=5Fcomplete=5Fas=5Froot;=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20local=20IFS=3D'=20';=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20COMPREPLY=3D($(compgen=20-g=20--=20"$1"));=20=20=20?= =?UTF-8?q?=20=20else=20=20=20=20=20=20=20=20=20local=20IFS=3D'=20=20';=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20"$(id=20-?= =?UTF-8?q?Gn=202>=20/dev/null=20||=20groups=202>=20/dev/null)"=20--=20"$1?= =?UTF-8?q?"));=20=20=20=20=20fi=20}=20=5Fallowed=5Fusers=20()=20{=20=20?= =?UTF-8?q?=20=20=20if=20=5Fcomplete=5Fas=5Froot;=20then=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20local=20IFS=3D'=20';=20=20=20=20=20=20=20=20=20COMPREP?= =?UTF-8?q?LY=3D($(compgen=20-u=20--=20"${1:-$cur}"));=20=20=20=20=20else?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20local=20IFS=3D'=20=20';=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20"$(id=20-un=202>?= =?UTF-8?q?=20/dev/null=20||=20whoami=202>=20/dev/null)"=20--=20"${1:-$cur?= =?UTF-8?q?}"));=20=20=20=20=20fi=20}=20=5Favailable=5Finterfaces=20()=20{?= =?UTF-8?q?=20=20=20=20=20local=20PATH=3D$PATH:/sbin;=20=20=20=20=20COMPRE?= =?UTF-8?q?PLY=3D($({=20if=20[[=20${1:-}=20=3D=3D=20-w=20]];=20then=20=20?= =?UTF-8?q?=20=20=20iwconfig;=20else=20=20=20=20=20if=20[[=20${1:-}=20=3D?= =?UTF-8?q?=3D=20-a=20]];=20then=20=20=20=20=20=20=20=20=20ifconfig=20||?= =?UTF-8?q?=20ip=20link=20show=20up;=20=20=20=20=20else=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20ifconfig=20-a=20||=20ip=20link=20show;=20=20=20=20=20f?= =?UTF-8?q?i;=20fi;=20}=202>=20/dev/null=20|=20awk=20'/^[^=20\t]/=20{=20if?= =?UTF-8?q?=20($1=20~=20/^[0-9]+:/)=20{=20print=20$2=20}=20else=20{=20prin?= =?UTF-8?q?t=20$1=20}=20}'));=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20?= =?UTF-8?q?'${COMPREPLY[@]/%[[:punct:]]/}'=20--=20"$cur"))=20}=20=5Fbashco?= =?UTF-8?q?mp=5Ftry=5Ffaketty=20()=20{=20=20=20=20=20if=20type=20unbuffer?= =?UTF-8?q?=20&>=20/dev/null;=20then=20=20=20=20=20=20=20=20=20unbuffer=20?= =?UTF-8?q?-p=20"$@";=20=20=20=20=20else=20=20=20=20=20=20=20=20=20if=20sc?= =?UTF-8?q?ript=20--version=202>&1=20|=20command=20grep=20-qF=20util-linux?= =?UTF-8?q?;=20then=20=20=20=20=20=20=20=20=20=20=20=20=20script=20-qaefc?= =?UTF-8?q?=20"$*"=20/dev/null;=20=20=20=20=20=20=20=20=20else=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20"$@";=20=20=20=20=20=20=20=20=20fi;?= =?UTF-8?q?=20=20=20=20=20fi=20}=20=5Fcd=20()=20{=20=20=20=20=20local=20cu?= =?UTF-8?q?r=20prev=20words=20cword;=20=20=20=20=20=5Finit=5Fcompletion=20?= =?UTF-8?q?||=20return;=20=20=20=20=20local=20IFS=3D'=20'=20i=20j=20k;=20?= =?UTF-8?q?=20=20=20=20compopt=20-o=20filenames;=20=20=20=20=20if=20[[=20-?= =?UTF-8?q?z=20${CDPATH:-}=20||=20$cur=20=3D=3D=20=3F(.)=3F(.)/*=20]];=20t?= =?UTF-8?q?hen=20=20=20=20=20=20=20=20=20=5Ffiledir=20-d;=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20return;=20=20=20=20=20fi;=20=20=20=20=20local=20-r?= =?UTF-8?q?=20mark=5Fdirs=3D$(=5Frl=5Fenabled=20mark-directories=20&&=20ec?= =?UTF-8?q?ho=20y);=20=20=20=20=20local=20-r=20mark=5Fsymdirs=3D$(=5Frl=5F?= =?UTF-8?q?enabled=20mark-symlinked-directories=20&&=20echo=20y);=20=20=20?= =?UTF-8?q?=20=20for=20i=20in=20${CDPATH//:/'=20'};=20=20=20=20=20do=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20k=3D"${#COMPREPLY[@]}";=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20for=20j=20in=20$(compgen=20-d=20--=20$i/$cur);=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20do=20=20=20=20=20=20=20=20=20=20=20=20=20i?= =?UTF-8?q?f=20[[=20(=20-n=20$mark=5Fsymdirs=20&&=20-L=20$j=20||=20-n=20$m?= =?UTF-8?q?ark=5Fdirs=20&&=20!=20-L=20$j=20)=20&&=20!=20-d=20${j#$i/}=20]]?= =?UTF-8?q?;=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20j+?= =?UTF-8?q?=3D"/";=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20COMPREPLY[k++]=3D${j#$i/};=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20done;=20=20=20=20=20done;=20=20=20=20=20=5Ffi?= =?UTF-8?q?ledir=20-d;=20=20=20=20=20if=20((${#COMPREPLY[@]}=20=3D=3D=201)?= =?UTF-8?q?);=20then=20=20=20=20=20=20=20=20=20i=3D${COMPREPLY[0]};=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20if=20[[=20$i=20=3D=3D=20"$cur"=20&&=20$i?= =?UTF-8?q?=20!=3D=20"*/"=20]];=20then=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20COMPREPLY[0]=3D"${i}/";=20=20=20=20=20=20=20=20=20fi;=20=20?= =?UTF-8?q?=20=20=20fi;=20=20=20=20=20return=20}=20=5Fcd=5Fdevices=20()=20?= =?UTF-8?q?{=20=20=20=20=20COMPREPLY+=3D($(compgen=20-f=20-d=20-X=20"!*/?= =?UTF-8?q?=3F([amrs])cd*"=20--=20"${cur:-/dev/}"))=20}=20=5Fcommand=20()?= =?UTF-8?q?=20{=20=20=20=20=20local=20offset=20i;=20=20=20=20=20offset=3D1?= =?UTF-8?q?;=20=20=20=20=20for=20((i=20=3D=201;=20i=20<=3D=20COMP=5FCWORD;?= =?UTF-8?q?=20i++))=20=20=20=20=20do=20=20=20=20=20=20=20=20=20if=20[[=20$?= =?UTF-8?q?{COMP=5FWORDS[i]}=20!=3D=20-*=20]];=20then=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20offset=3D$i;=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20break;=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20done;?= =?UTF-8?q?=20=20=20=20=20=5Fcommand=5Foffset=20$offset=20}=20=5Fcommand?= =?UTF-8?q?=5Foffset=20()=20{=20=20=20=20=20local=20word=5Foffset=3D$1=20i?= =?UTF-8?q?=20j;=20=20=20=20=20for=20((i=20=3D=200;=20i=20<=20word=5Foffse?= =?UTF-8?q?t;=20i++))=20=20=20=20=20do=20=20=20=20=20=20=20=20=20for=20((j?= =?UTF-8?q?=20=3D=200;=20j=20<=3D=20${#COMP=5FLINE};=20j++))=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20do=20=20=20=20=20=20=20=20=20=20=20=20=20[[=20$C?= =?UTF-8?q?OMP=5FLINE=20=3D=3D=20"${COMP=5FWORDS[i]}"*=20]]=20&&=20break;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20COMP=5FLINE=3D${COMP=5FL?= =?UTF-8?q?INE:1};=20=20=20=20=20=20=20=20=20=20=20=20=20((COMP=5FPOINT--)?= =?UTF-8?q?);=20=20=20=20=20=20=20=20=20done;=20=20=20=20=20=20=20=20=20CO?= =?UTF-8?q?MP=5FLINE=3D${COMP=5FLINE#"${COMP=5FWORDS[i]}"};=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20((COMP=5FPOINT=20-=3D=20${#COMP=5FWORDS[i]}));=20?= =?UTF-8?q?=20=20=20=20done;=20=20=20=20=20for=20((i=20=3D=200;=20i=20<=3D?= =?UTF-8?q?=20COMP=5FCWORD=20-=20word=5Foffset;=20i++))=20=20=20=20=20do?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20COMP=5FWORDS[i]=3D${COMP=5FWORDS[i?= =?UTF-8?q?=20+=20word=5Foffset]};=20=20=20=20=20done;=20=20=20=20=20for?= =?UTF-8?q?=20((i;=20i=20<=3D=20COMP=5FCWORD;=20i++))=20=20=20=20=20do=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20unset=20'COMP=5FWORDS[i]';=20=20=20=20?= =?UTF-8?q?=20done;=20=20=20=20=20((COMP=5FCWORD=20-=3D=20word=5Foffset));?= =?UTF-8?q?=20=20=20=20=20COMPREPLY=3D();=20=20=20=20=20local=20cur;=20=20?= =?UTF-8?q?=20=20=20=5Fget=5Fcomp=5Fwords=5Fby=5Fref=20cur;=20=20=20=20=20?= =?UTF-8?q?if=20((COMP=5FCWORD=20=3D=3D=200));=20then=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20local=20IFS=3D'=20';=20=20=20=20=20=20=20=20=20compopt=20?= =?UTF-8?q?-o=20filenames;=20=20=20=20=20=20=20=20=20COMPREPLY=3D($(compge?= =?UTF-8?q?n=20-d=20-c=20--=20"$cur"));=20=20=20=20=20else=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20local=20cmd=3D${COMP=5FWORDS[0]}=20compcmd=3D${COMP?= =?UTF-8?q?=5FWORDS[0]};=20=20=20=20=20=20=20=20=20local=20cspec=3D$(compl?= =?UTF-8?q?ete=20-p=20$cmd=202>=20/dev/null);=20=20=20=20=20=20=20=20=20if?= =?UTF-8?q?=20[[=20!=20-n=20$cspec=20&&=20$cmd=20=3D=3D=20*/*=20]];=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20cspec=3D$(complete=20-p?= =?UTF-8?q?=20${cmd##*/}=202>=20/dev/null);=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20[[=20-n=20$cspec=20]]=20&&=20compcmd=3D${cmd##*/};=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20if=20[[?= =?UTF-8?q?=20!=20-n=20$cspec=20]];=20then=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20compcmd=3D${cmd##*/};=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=5Fcompletion=5Floader=20$compcmd;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20cspec=3D$(complete=20-p=20$compcmd=202>=20/de?= =?UTF-8?q?v/null);=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20if=20[[=20-n=20$cspec=20]];=20then=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20if=20[[=20${cspec#*=20-F=20}=20!=3D=20"$cspec"?= =?UTF-8?q?=20]];=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20local=20func=3D${cspec#*-F=20};=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20func=3D${func%%=20*};=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20if=20((${#COMP=5FWORDS[@]}=20>?= =?UTF-8?q?=3D=202));=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20$func=20$cmd=20"${COMP=5FWORDS[-1]}"=20"${COM?= =?UTF-8?q?P=5FWORDS[-2]}";=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20else=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20$func=20$cmd=20"${COMP=5FWORDS[-1]}";=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20local=20opt;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20while=20[[=20$cspec=20=3D=3D=20*"?= =?UTF-8?q?=20-o=20"*=20]];=20do=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20cspec=3D${cspec#*-o=20};=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20opt=3D${cspec%%=20?= =?UTF-8?q?*};=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20compopt=20-o=20$opt;=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20cspec=3D${cspec#$opt};=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20done;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20cspec=3D${cspec#complete};=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20cspec=3D${cspec%%$compcmd};=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20COMPREPLY=3D($(eval?= =?UTF-8?q?=20compgen=20"$cspec"=20--=20'$cur'));=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20else=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20if=20((${#COMPREPLY[@]}=20=3D=3D=200?= =?UTF-8?q?));=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=5Fminimal;=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20fi;=20=20=20=20=20fi=20}=20=5Fcomplete=5Fas?= =?UTF-8?q?=5Froot=20()=20{=20=20=20=20=20[[=20$EUID=20-eq=200=20||=20-n?= =?UTF-8?q?=20${root=5Fcommand:-}=20]]=20}=20=5Fcompletion=5Floader=20()?= =?UTF-8?q?=20{=20=20=20=20=20local=20cmd=3D"${1:-=5FEmptycmD=5F}";=20=20?= =?UTF-8?q?=20=20=20=5F=5Fload=5Fcompletion=20"$cmd"=20&&=20return=20124;?= =?UTF-8?q?=20=20=20=20=20complete=20-F=20=5Fminimal=20--=20"$cmd"=20&&=20?= =?UTF-8?q?return=20124=20}=20=5Fconfigured=5Finterfaces=20()=20{=20=20=20?= =?UTF-8?q?=20=20if=20[[=20-f=20/etc/debian=5Fversion=20]];=20then=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20"$(command?= =?UTF-8?q?=20sed=20-ne=20's|^iface=20\([^=20]\{1,\}\).*$|\1|p'=20/etc/net?= =?UTF-8?q?work/interfaces=20/etc/network/interfaces.d/*=202>=20/dev/null)?= =?UTF-8?q?"=20--=20"$cur"));=20=20=20=20=20else=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20if=20[[=20-f=20/etc/SuSE-release=20]];=20then=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20"$(printf?= =?UTF-8?q?=20'%s\n'=20/etc/sysconfig/network/ifcfg-*=20|=20command=20sed?= =?UTF-8?q?=20-ne=20's|.*ifcfg-\([^*].*\)$|\1|p')"=20--=20"$cur"));=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20if=20[[=20-f=20/etc/pld-release=20]];=20then=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20COMPREPLY=3D($(compgen=20-W?= =?UTF-8?q?=20"$(command=20ls=20-B=20/etc/sysconfig/interfaces=20|=20comma?= =?UTF-8?q?nd=20sed=20-ne=20's|.*ifcfg-\([^*].*\)$|\1|p')"=20--=20"$cur"))?= =?UTF-8?q?;=20=20=20=20=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20?= =?UTF-8?q?"$(printf=20'%s\n'=20/etc/sysconfig/network-scripts/ifcfg-*=20|?= =?UTF-8?q?=20command=20sed=20-ne=20's|.*ifcfg-\([^*].*\)$|\1|p')"=20--=20?= =?UTF-8?q?"$cur"));=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20fi=20}=20=5Fcount=5Fargs=20()?= =?UTF-8?q?=20{=20=20=20=20=20local=20i=20cword=20words;=20=20=20=20=20=5F?= =?UTF-8?q?=5Freassemble=5Fcomp=5Fwords=5Fby=5Fref=20"${1-}"=20words=20cwo?= =?UTF-8?q?rd;=20=20=20=20=20args=3D1;=20=20=20=20=20for=20((i=20=3D=201;?= =?UTF-8?q?=20i=20<=20cword;=20i++))=20=20=20=20=20do=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20if=20[[=20${words[i]}=20!=3D=20-*=20&&=20${words[i=20-=20?= =?UTF-8?q?1]}=20!=3D=20${2-}=20||=20${words[i]}=20=3D=3D=20${3-}=20]];=20?= =?UTF-8?q?then=20=20=20=20=20=20=20=20=20=20=20=20=20((args++));=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20fi;=20=20=20=20=20done=20}=20=5Fdvd=5Fdevices?= =?UTF-8?q?=20()=20{=20=20=20=20=20COMPREPLY+=3D($(compgen=20-f=20-d=20-X?= =?UTF-8?q?=20"!*/=3F(r)dvd*"=20--=20"${cur:-/dev/}"))=20}=20=5Fexpand=20(?= =?UTF-8?q?)=20{=20=20=20=20=20case=20${cur-}=20in=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20~*/*)=20=20=20=20=20=20=20=20=20=20=20=20=20=5F=5Fexpand=5Ft?= =?UTF-8?q?ilde=5Fby=5Fref=20cur=20=20=20=20=20=20=20=20=20;;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20~*)=20=20=20=20=20=20=20=20=20=20=20=20=20=5Ftil?= =?UTF-8?q?de=20"$cur"=20||=20eval=20COMPREPLY[0]=3D"$(printf=20~%q=20"${C?= =?UTF-8?q?OMPREPLY[0]#\~}")";=20=20=20=20=20=20=20=20=20=20=20=20=20retur?= =?UTF-8?q?n=20${#COMPREPLY[@]}=20=20=20=20=20=20=20=20=20;;=20=20=20=20?= =?UTF-8?q?=20esac=20}=20=5Ffiledir=20()=20{=20=20=20=20=20local=20IFS=3D'?= =?UTF-8?q?=20';=20=20=20=20=20=5Ftilde=20"${cur-}"=20||=20return;=20=20?= =?UTF-8?q?=20=20=20local=20-a=20toks;=20=20=20=20=20local=20reset=20arg?= =?UTF-8?q?=3D${1-};=20=20=20=20=20if=20[[=20$arg=20=3D=3D=20-d=20]];=20th?= =?UTF-8?q?en=20=20=20=20=20=20=20=20=20reset=3D$(shopt=20-po=20noglob);?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20set=20-o=20noglob;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20toks=3D($(compgen=20-d=20--=20"${cur-}"));=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20IFS=3D'=20';=20=20=20=20=20=20=20=20=20$reset;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20IFS=3D'=20';=20=20=20=20=20else=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20local=20quoted;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=5Fquote=5Freadline=5Fby=5Fref=20"${cur-}"=20quoted;=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20local=20xspec=3D${arg:+"!*.@($arg|${arg^^}?= =?UTF-8?q?)"}=20plusdirs=3D();=20=20=20=20=20=20=20=20=20local=20opts=3D(?= =?UTF-8?q?-f=20-X=20"$xspec");=20=20=20=20=20=20=20=20=20[[=20-n=20$xspec?= =?UTF-8?q?=20]]=20&&=20plusdirs=3D(-o=20plusdirs);=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20[[=20-n=20${COMP=5FFILEDIR=5FFALLBACK-}=20||=20-z=20${plu?= =?UTF-8?q?sdirs-}=20]]=20||=20opts+=3D("${plusdirs[@]}");=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20reset=3D$(shopt=20-po=20noglob);=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20set=20-o=20noglob;=20=20=20=20=20=20=20=20=20toks+=3D(?= =?UTF-8?q?$(compgen=20"${opts[@]}"=20--=20$quoted));=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20IFS=3D'=20';=20=20=20=20=20=20=20=20=20$reset;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20IFS=3D'=20';=20=20=20=20=20=20=20=20=20[[=20-?= =?UTF-8?q?n=20${COMP=5FFILEDIR=5FFALLBACK-}=20&&=20-n=20$arg=20&&=20${#to?= =?UTF-8?q?ks[@]}=20-lt=201=20]]=20&&=20{=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20reset=3D$(shopt=20-po=20noglob);=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20set=20-o=20noglob;=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20toks+=3D($(compgen=20-f=20${plusdirs+"${plusdirs[@]}"}?= =?UTF-8?q?=20--=20$quoted));=20=20=20=20=20=20=20=20=20=20=20=20=20IFS=3D?= =?UTF-8?q?'=20';=20=20=20=20=20=20=20=20=20=20=20=20=20$reset;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20IFS=3D'=20'=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20};=20=20=20=20=20fi;=20=20=20=20=20if=20((${#toks[@]}=20!?= =?UTF-8?q?=3D=200));=20then=20=20=20=20=20=20=20=20=20compopt=20-o=20file?= =?UTF-8?q?names=202>=20/dev/null;=20=20=20=20=20=20=20=20=20COMPREPLY+=3D?= =?UTF-8?q?("${toks[@]}");=20=20=20=20=20fi=20}=20=5Ffiledir=5Fxspec=20()?= =?UTF-8?q?=20{=20=20=20=20=20local=20cur=20prev=20words=20cword;=20=20=20?= =?UTF-8?q?=20=20=5Finit=5Fcompletion=20||=20return;=20=20=20=20=20=5Ftild?= =?UTF-8?q?e=20"$cur"=20||=20return;=20=20=20=20=20local=20IFS=3D'=20'=20x?= =?UTF-8?q?spec=3D${=5Fxspecs[${1##*/}]}=20tmp;=20=20=20=20=20local=20-a?= =?UTF-8?q?=20toks;=20=20=20=20=20toks=3D($(compgen=20-d=20--=20"$(quote?= =?UTF-8?q?=5Freadline=20"$cur")"=20|=20{=20while=20read=20-r=20tmp;=20do?= =?UTF-8?q?=20=20=20=20=20printf=20'%s\n'=20$tmp;=20done;=20}));=20=20=20?= =?UTF-8?q?=20=20eval=20xspec=3D"${xspec}";=20=20=20=20=20local=20matchop?= =?UTF-8?q?=3D!;=20=20=20=20=20if=20[[=20$xspec=20=3D=3D=20!*=20]];=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20xspec=3D${xspec#!};=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20matchop=3D@;=20=20=20=20=20fi;=20=20=20=20=20xspec?= =?UTF-8?q?=3D"$matchop($xspec|${xspec^^})";=20=20=20=20=20toks+=3D($(eval?= =?UTF-8?q?=20compgen=20-f=20-X=20"'!$xspec'"=20--=20'$(quote=5Freadline?= =?UTF-8?q?=20"$cur")'=20|=20{=20while=20read=20-r=20tmp;=20do=20=20=20=20?= =?UTF-8?q?=20[[=20-n=20$tmp=20]]=20&&=20printf=20'%s\n'=20$tmp;=20done;?= =?UTF-8?q?=20}));=20=20=20=20=20[[=20-n=20${COMP=5FFILEDIR=5FFALLBACK:-}?= =?UTF-8?q?=20&&=20${#toks[@]}=20-lt=201=20]]=20&&=20{=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20local=20reset=3D$(shopt=20-po=20noglob);=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20set=20-o=20noglob;=20=20=20=20=20=20=20=20=20tok?= =?UTF-8?q?s+=3D($(compgen=20-f=20--=20"$(quote=5Freadline=20"$cur")"));?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20IFS=3D'=20';=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20$reset;=20=20=20=20=20=20=20=20=20IFS=3D'=20'=20=20=20=20=20?= =?UTF-8?q?};=20=20=20=20=20if=20((${#toks[@]}=20!=3D=200));=20then=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20compopt=20-o=20filenames;=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20COMPREPLY=3D("${toks[@]}");=20=20=20=20=20fi=20}=20?= =?UTF-8?q?=5Ffstypes=20()=20{=20=20=20=20=20local=20fss;=20=20=20=20=20if?= =?UTF-8?q?=20[[=20-e=20/proc/filesystems=20]];=20then=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20fss=3D"$(cut=20-d'=09'=20-f2=20/proc/filesystems)=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20$(awk=20'!=20/\*/=20{=20?= =?UTF-8?q?print=20$NF=20}'=20/etc/filesystems=202>=20/dev/null)";=20=20?= =?UTF-8?q?=20=20=20else=20=20=20=20=20=20=20=20=20fss=3D"$(awk=20'/^[=20\?= =?UTF-8?q?t]*[^#]/=20{=20print=20$3=20}'=20/etc/fstab=202>=20/dev/null)?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20$(awk=20'/^[=20\t]*[^?= =?UTF-8?q?#]/=20{=20print=20$3=20}'=20/etc/mnttab=202>=20/dev/null)=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20$(awk=20'/^[=20\t]*[^#]/=20?= =?UTF-8?q?{=20print=20$4=20}'=20/etc/vfstab=202>=20/dev/null)=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20$(awk=20'{=20print=20$1=20}'=20/e?= =?UTF-8?q?tc/dfs/fstypes=202>=20/dev/null)=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20$([[=20-d=20/etc/fs=20]]=20&&=20command=20ls=20/etc?= =?UTF-8?q?/fs)";=20=20=20=20=20fi;=20=20=20=20=20[[=20-n=20$fss=20]]=20&&?= =?UTF-8?q?=20COMPREPLY+=3D($(compgen=20-W=20"$fss"=20--=20"$cur"))=20}=20?= =?UTF-8?q?=5Fget=5Fcomp=5Fwords=5Fby=5Fref=20()=20{=20=20=20=20=20local?= =?UTF-8?q?=20exclude=20flag=20i=20OPTIND=3D1;=20=20=20=20=20local=20cur?= =?UTF-8?q?=20cword=20words=3D();=20=20=20=20=20local=20upargs=3D()=20upva?= =?UTF-8?q?rs=3D()=20vcur=20vcword=20vprev=20vwords;=20=20=20=20=20while?= =?UTF-8?q?=20getopts=20"c:i:n:p:w:"=20flag=20"$@";=20do=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20case=20$flag=20in=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20c)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20vcur=3D?= =?UTF-8?q?$OPTARG=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20i)=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20vcword=3D$OPTARG=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20n)=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20exclude=3D$OPTARG=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20p)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20vprev=3D$OPTARG=20=20=20=20=20=20=20=20=20=20=20=20=20;;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20w)=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20vwords=3D$OPTARG=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20*)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20echo=20?= =?UTF-8?q?"bash=5Fcompletion:=20$FUNCNAME:=20usage=20error"=201>&2;=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20return=201=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20e?= =?UTF-8?q?sac;=20=20=20=20=20done;=20=20=20=20=20while=20[[=20$#=20-ge=20?= =?UTF-8?q?$OPTIND=20]];=20do=20=20=20=20=20=20=20=20=20case=20${!OPTIND}?= =?UTF-8?q?=20in=20=20=20=20=20=20=20=20=20=20=20=20=20cur)=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20vcur=3Dcur=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20prev)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20vpre?= =?UTF-8?q?v=3Dprev=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20cword)=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20vcword=3Dcword=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20words)=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20vwords=3Dwords?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20*)=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20echo=20"bash=5Fcompletion:=20$FUNCNAME:=20\`${!OPTIND}?= =?UTF-8?q?':"=20"unknown=20argument"=201>&2;=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20return=201=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20;;=20=20=20=20=20=20=20=20=20esac;=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20((OPTIND=20+=3D=201));=20=20=20=20=20done;=20=20=20?= =?UTF-8?q?=20=20=5F=5Fget=5Fcword=5Fat=5Fcursor=5Fby=5Fref=20"${exclude-}?= =?UTF-8?q?"=20words=20cword=20cur;=20=20=20=20=20[[=20-v=20vcur=20]]=20&&?= =?UTF-8?q?=20{=20=20=20=20=20=20=20=20=20upvars+=3D("$vcur");=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20upargs+=3D(-v=20$vcur=20"$cur")=20=20=20=20=20};?= =?UTF-8?q?=20=20=20=20=20[[=20-v=20vcword=20]]=20&&=20{=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20upvars+=3D("$vcword");=20=20=20=20=20=20=20=20=20uparg?= =?UTF-8?q?s+=3D(-v=20$vcword=20"$cword")=20=20=20=20=20};=20=20=20=20=20[?= =?UTF-8?q?[=20-v=20vprev=20&&=20$cword=20-ge=201=20]]=20&&=20{=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20upvars+=3D("$vprev");=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20upargs+=3D(-v=20$vprev=20"${words[cword=20-=201]}")=20=20=20?= =?UTF-8?q?=20=20};=20=20=20=20=20[[=20-v=20vwords=20]]=20&&=20{=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20upvars+=3D("$vwords");=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20upargs+=3D(-a${#words[@]}=20$vwords=20${words+"${words[@]?= =?UTF-8?q?}"})=20=20=20=20=20};=20=20=20=20=20((${#upvars[@]}))=20&&=20lo?= =?UTF-8?q?cal=20"${upvars[@]}"=20&&=20=5Fupvars=20"${upargs[@]}"=20}=20?= =?UTF-8?q?=5Fget=5Fcword=20()=20{=20=20=20=20=20local=20LC=5FCTYPE=3DC;?= =?UTF-8?q?=20=20=20=20=20local=20cword=20words;=20=20=20=20=20=5F=5Freass?= =?UTF-8?q?emble=5Fcomp=5Fwords=5Fby=5Fref=20"${1-}"=20words=20cword;=20?= =?UTF-8?q?=20=20=20=20if=20[[=20-n=20${2-}=20&&=20-n=20${2//[^0-9]/}=20]]?= =?UTF-8?q?;=20then=20=20=20=20=20=20=20=20=20printf=20"%s"=20"${words[cwo?= =?UTF-8?q?rd=20-=20$2]}";=20=20=20=20=20else=20=20=20=20=20=20=20=20=20if?= =?UTF-8?q?=20((${#words[cword]}=20=3D=3D=200=20&&=20COMP=5FPOINT=20=3D=3D?= =?UTF-8?q?=20${#COMP=5FLINE}));=20then=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20:;=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20local=20i;=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20local=20cur=3D"$COMP=5FLINE";=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20local=20index=3D"$COMP=5FPOINT";=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20for=20((i=20=3D=200;=20i=20<=3D=20cword;=20++?= =?UTF-8?q?i))=20=20=20=20=20=20=20=20=20=20=20=20=20do=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20while=20[[=20${#cur}=20-ge=20$?= =?UTF-8?q?{#words[i]}=20&&=20${cur:0:${#words[i]}}=20!=3D=20"${words[i]}"?= =?UTF-8?q?=20]];=20do=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20cur=3D"${cur:1}";=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20((index=20>=200))=20&&=20((index-?= =?UTF-8?q?-));=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20done;=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20if=20((i=20<=20?= =?UTF-8?q?cword));=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20local=20old=5Fsize=3D"${#cur}";=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20cur=3D"${cur#${?= =?UTF-8?q?words[i]}}";=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20local=20new=5Fsize=3D"${#cur}";=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20((index=20-=3D=20o?= =?UTF-8?q?ld=5Fsize=20-=20new=5Fsize));=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20=20=20=20=20don?= =?UTF-8?q?e;=20=20=20=20=20=20=20=20=20=20=20=20=20if=20[[=20${words[cwor?= =?UTF-8?q?d]:0:${#cur}}=20!=3D=20"$cur"=20]];=20then=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20printf=20"%s"=20"${words[cword]}"?= =?UTF-8?q?;=20=20=20=20=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20printf=20"%s"=20"${cur:0:index?= =?UTF-8?q?}";=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20fi;=20=20=20=20=20fi=20}=20=5Fget=5Ffirst=5Farg=20()?= =?UTF-8?q?=20{=20=20=20=20=20local=20i;=20=20=20=20=20arg=3D;=20=20=20=20?= =?UTF-8?q?=20for=20((i=20=3D=201;=20i=20<=20COMP=5FCWORD;=20i++))=20=20?= =?UTF-8?q?=20=20=20do=20=20=20=20=20=20=20=20=20if=20[[=20${COMP=5FWORDS[?= =?UTF-8?q?i]}=20!=3D=20-*=20]];=20then=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20arg=3D${COMP=5FWORDS[i]};=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20break;=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20don?= =?UTF-8?q?e=20}=20=5Fget=5Fpword=20()=20{=20=20=20=20=20if=20((COMP=5FCWO?= =?UTF-8?q?RD=20>=3D=201));=20then=20=20=20=20=20=20=20=20=20=5Fget=5Fcwor?= =?UTF-8?q?d=20"${@:-}"=201;=20=20=20=20=20fi=20}=20=5Fgids=20()=20{=20=20?= =?UTF-8?q?=20=20=20if=20type=20getent=20&>=20/dev/null;=20then=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20'$(getent=20gro?= =?UTF-8?q?up=20|=20cut=20-d:=20-f3)'=20--=20"$cur"));=20=20=20=20=20else?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20if=20type=20perl=20&>=20/dev/null;?= =?UTF-8?q?=20then=20=20=20=20=20=20=20=20=20=20=20=20=20COMPREPLY=3D($(co?= =?UTF-8?q?mpgen=20-W=20'$(perl=20-e=20'"'"'while=20(($gid)=20=3D=20(getgr?= =?UTF-8?q?ent)[2])=20{=20print=20$gid=20.=20"\n"=20}'"'"')'=20--=20"$cur"?= =?UTF-8?q?));=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20COMPREPLY=3D($(compgen=20-W=20'$(cut=20-d:=20-f3=20?= =?UTF-8?q?/etc/group)'=20--=20"$cur"));=20=20=20=20=20=20=20=20=20fi;=20?= =?UTF-8?q?=20=20=20=20fi=20}=20=5Fhave=20()=20{=20=20=20=20=20PATH=3D$PAT?= =?UTF-8?q?H:/usr/sbin:/sbin:/usr/local/sbin=20type=20$1=20&>=20/dev/null?= =?UTF-8?q?=20}=20=5Fincluded=5Fssh=5Fconfig=5Ffiles=20()=20{=20=20=20=20?= =?UTF-8?q?=20(($#=20<=201))=20&&=20echo=20"bash=5Fcompletion:=20$FUNCNAME?= =?UTF-8?q?:=20missing=20mandatory=20argument=20CONFIG"=201>&2;=20=20=20?= =?UTF-8?q?=20=20local=20configfile=20i=20f;=20=20=20=20=20configfile=3D$1?= =?UTF-8?q?;=20=20=20=20=20local=20reset=3D$(shopt=20-po=20noglob);=20=20?= =?UTF-8?q?=20=20=20set=20-o=20noglob;=20=20=20=20=20local=20included=3D($?= =?UTF-8?q?(command=20sed=20-ne=20's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd]?= =?UTF-8?q?[Ee][[:blank:]]\(.*\)$/\1/p'=20"${configfile}"));=20=20=20=20?= =?UTF-8?q?=20$reset;=20=20=20=20=20[[=20-n=20${included-}=20]]=20||=20ret?= =?UTF-8?q?urn;=20=20=20=20=20for=20i=20in=20"${included[@]}";=20=20=20=20?= =?UTF-8?q?=20do=20=20=20=20=20=20=20=20=20if=20!=20[[=20$i=20=3D~=20^\~.*?= =?UTF-8?q?|^\/.*=20]];=20then=20=20=20=20=20=20=20=20=20=20=20=20=20if=20?= =?UTF-8?q?[[=20$configfile=20=3D~=20^\/etc\/ssh.*=20]];=20then=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20i=3D"/etc/ssh/$i";=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20i=3D"$HOME/.ssh/$i";=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20fi;=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=5F=5Fexpand=5Ftilde=5Fby=5Fref=20i;=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20set=20+o=20noglob;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20for=20f=20in=20$i;=20=20=20=20=20=20=20=20=20do=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20if=20[[=20-r=20$f=20]];=20then=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20config+=3D("$f"?= =?UTF-8?q?);=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=5Finclude?= =?UTF-8?q?d=5Fssh=5Fconfig=5Ffiles=20$f;=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20fi;=20=20=20=20=20=20=20=20=20done;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20$reset;=20=20=20=20=20done=20}=20=5Finit=5Fcompletion=20(?= =?UTF-8?q?)=20{=20=20=20=20=20local=20exclude=3D""=20flag=20outx=20errx?= =?UTF-8?q?=20inx=20OPTIND=3D1;=20=20=20=20=20while=20getopts=20"n:e:o:i:s?= =?UTF-8?q?"=20flag=20"$@";=20do=20=20=20=20=20=20=20=20=20case=20$flag=20?= =?UTF-8?q?in=20=20=20=20=20=20=20=20=20=20=20=20=20n)=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20exclude+=3D$OPTARG=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20e)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20errx?= =?UTF-8?q?=3D$OPTARG=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20o)=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20outx=3D$OPTARG=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20i)=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20inx=3D$OPTARG=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20s)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20split=3Dfalse;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20exclude+=3D=3D=20=20=20=20=20=20=20=20=20=20=20=20=20;;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20*)=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20echo=20"bash=5Fcompletion:=20$FUN?= =?UTF-8?q?CNAME:=20usage=20error"=201>&2;=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20return=201=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20;;=20=20=20=20=20=20=20=20=20esac;=20=20=20=20=20done;?= =?UTF-8?q?=20=20=20=20=20COMPREPLY=3D();=20=20=20=20=20local=20redir=3D"@?= =?UTF-8?q?(=3F([0-9])<|=3F([0-9&])>=3F(>)|>&)";=20=20=20=20=20=5Fget=5Fco?= =?UTF-8?q?mp=5Fwords=5Fby=5Fref=20-n=20"$exclude<>&"=20cur=20prev=20words?= =?UTF-8?q?=20cword;=20=20=20=20=20=5Fvariables=20&&=20return=201;=20=20?= =?UTF-8?q?=20=20=20if=20[[=20$cur=20=3D=3D=20$redir*=20||=20${prev-}=20?= =?UTF-8?q?=3D=3D=20$redir=20]];=20then=20=20=20=20=20=20=20=20=20local=20?= =?UTF-8?q?xspec;=20=20=20=20=20=20=20=20=20case=20$cur=20in=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=202'>'*)=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20xspec=3D${errx-}=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20*'>'*)?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20xspec=3D${ou?= =?UTF-8?q?tx-}=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20*'<'*)=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20xspec=3D${inx-}=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20*)=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20case=20$prev=20in=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=202'>'*)?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20xspec=3D${errx-}=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20*'>'*)=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20xspec=3D${ou?= =?UTF-8?q?tx-}=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20*'<'*)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20xspec=3D${inx-}=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20esac=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20esac;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20cur=3D"${cur##$redir}";=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=5Ffiledir=20$xspec;=20=20=20=20=20=20=20=20=20return=201;?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20local=20i=20skip;=20=20=20=20?= =?UTF-8?q?=20for=20((i=20=3D=201;=20i=20<=20${#words[@]};=201))=20=20=20?= =?UTF-8?q?=20=20do=20=20=20=20=20=20=20=20=20if=20[[=20${words[i]}=20=3D?= =?UTF-8?q?=3D=20$redir*=20]];=20then=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20[[=20${words[i]}=20=3D=3D=20$redir=20]]=20&&=20skip=3D2=20||?= =?UTF-8?q?=20skip=3D1;=20=20=20=20=20=20=20=20=20=20=20=20=20words=3D("${?= =?UTF-8?q?words[@]:0:i}"=20"${words[@]:i+skip}");=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20((i=20<=3D=20cword))=20&&=20((cword=20-=3D=20ski?= =?UTF-8?q?p));=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20((i++));=20=20=20=20=20=20=20=20=20fi;=20=20=20=20?= =?UTF-8?q?=20done;=20=20=20=20=20((cword=20<=3D=200))=20&&=20return=201;?= =?UTF-8?q?=20=20=20=20=20prev=3D${words[cword=20-=201]};=20=20=20=20=20[[?= =?UTF-8?q?=20-n=20${split-}=20]]=20&&=20=5Fsplit=5Flongopt=20&&=20split?= =?UTF-8?q?=3Dtrue;=20=20=20=20=20return=200=20}=20=5Finstalled=5Fmodules?= =?UTF-8?q?=20()=20{=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20"$(PATH?= =?UTF-8?q?=3D"$PATH:/sbin"=20lsmod=20|=20awk=20'{if=20(NR=20!=3D=201)=20p?= =?UTF-8?q?rint=20$1}')"=20--=20"$1"))=20}=20=5Fip=5Faddresses=20()=20{=20?= =?UTF-8?q?=20=20=20=20local=20n;=20=20=20=20=20case=20${1-}=20in=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20-a)=20=20=20=20=20=20=20=20=20=20=20=20=20n?= =?UTF-8?q?=3D'6\=3F'=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20-6)=20=20=20=20=20=20=20=20=20=20=20=20=20n=3D'6'=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20*)=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20n=3D=20=20=20=20=20=20=20=20=20;;=20?= =?UTF-8?q?=20=20=20=20esac;=20=20=20=20=20local=20PATH=3D$PATH:/sbin;=20?= =?UTF-8?q?=20=20=20=20local=20addrs=3D$({=20LC=5FALL=3DC=20ifconfig=20-a?= =?UTF-8?q?=20||=20ip=20addr=20show;=20}=202>=20/dev/null=20|=20command=20?= =?UTF-8?q?sed=20-e=20's/[[:space:]]addr:/=20/'=20-ne=20"s|.*inet${n}[[:sp?= =?UTF-8?q?ace:]]\{1,\}\([^[:space:]/]*\).*|\1|p");=20=20=20=20=20COMPREPL?= =?UTF-8?q?Y+=3D($(compgen=20-W=20"$addrs"=20--=20"${cur-}"))=20}=20=5Fker?= =?UTF-8?q?nel=5Fversions=20()=20{=20=20=20=20=20COMPREPLY=3D($(compgen=20?= =?UTF-8?q?-W=20'$(command=20ls=20/lib/modules)'=20--=20"$cur"))=20}=20=5F?= =?UTF-8?q?known=5Fhosts=20()=20{=20=20=20=20=20local=20cur=20prev=20words?= =?UTF-8?q?=20cword;=20=20=20=20=20=5Finit=5Fcompletion=20-n=20:=20||=20re?= =?UTF-8?q?turn;=20=20=20=20=20local=20options;=20=20=20=20=20[[=20${1-}?= =?UTF-8?q?=20=3D=3D=20-a=20||=20${2-}=20=3D=3D=20-a=20]]=20&&=20options?= =?UTF-8?q?=3D-a;=20=20=20=20=20[[=20${1-}=20=3D=3D=20-c=20||=20${2-}=20?= =?UTF-8?q?=3D=3D=20-c=20]]=20&&=20options+=3D"=20-c";=20=20=20=20=20=5Fkn?= =?UTF-8?q?own=5Fhosts=5Freal=20${options-}=20--=20"$cur"=20}=20=5Fknown?= =?UTF-8?q?=5Fhosts=5Freal=20()=20{=20=20=20=20=20local=20configfile=20fla?= =?UTF-8?q?g=20prefix=3D""=20ifs=3D$IFS;=20=20=20=20=20local=20cur=20suffi?= =?UTF-8?q?x=3D""=20aliases=20i=20host=20ipv4=20ipv6;=20=20=20=20=20local?= =?UTF-8?q?=20-a=20kh=20tmpkh=3D()=20khd=3D()=20config=3D();=20=20=20=20?= =?UTF-8?q?=20local=20OPTIND=3D1;=20=20=20=20=20while=20getopts=20"ac46F:p?= =?UTF-8?q?:"=20flag=20"$@";=20do=20=20=20=20=20=20=20=20=20case=20$flag?= =?UTF-8?q?=20in=20=20=20=20=20=20=20=20=20=20=20=20=20a)=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20aliases=3D'yes'=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20c)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20suff?= =?UTF-8?q?ix=3D':'=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20F)=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20configfile=3D$OPTARG=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20p)=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20prefix=3D$OPTAR?= =?UTF-8?q?G=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=204)=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20ipv4=3D1=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=206)=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20ipv6=3D1=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20*)=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20echo=20"bash=5Fcom?= =?UTF-8?q?pletion:=20$FUNCNAME:=20usage=20error"=201>&2;=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20return=201=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20esac;=20?= =?UTF-8?q?=20=20=20=20done;=20=20=20=20=20if=20(($#=20<=20OPTIND));=20the?= =?UTF-8?q?n=20=20=20=20=20=20=20=20=20echo=20"bash=5Fcompletion:=20$FUNCN?= =?UTF-8?q?AME:=20missing=20mandatory=20argument=20CWORD"=201>&2;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20return=201;=20=20=20=20=20fi;=20=20=20=20=20c?= =?UTF-8?q?ur=3D${!OPTIND};=20=20=20=20=20((OPTIND=20+=3D=201));=20=20=20?= =?UTF-8?q?=20=20if=20(($#=20>=3D=20OPTIND));=20then=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20echo=20"bash=5Fcompletion:=20$FUNCNAME($*):=20unprocessed?= =?UTF-8?q?=20arguments:"=20"$(while=20(($#=20>=3D=20OPTIND));=20do=20=20?= =?UTF-8?q?=20=20=20printf=20'%s=20'=20${!OPTIND}=20shift;=20done)"=201>&2?= =?UTF-8?q?;=20=20=20=20=20=20=20=20=20return=201;=20=20=20=20=20fi;=20=20?= =?UTF-8?q?=20=20=20[[=20$cur=20=3D=3D=20*@*=20]]=20&&=20prefix=3D$prefix$?= =?UTF-8?q?{cur%@*}@=20&&=20cur=3D${cur#*@};=20=20=20=20=20kh=3D();=20=20?= =?UTF-8?q?=20=20=20if=20[[=20-v=20configfile=20]];=20then=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20[[=20-r=20$configfile=20]]=20&&=20config+=3D("$conf?= =?UTF-8?q?igfile");=20=20=20=20=20else=20=20=20=20=20=20=20=20=20for=20i?= =?UTF-8?q?=20in=20/etc/ssh/ssh=5Fconfig=20~/.ssh/config=20~/.ssh2/config;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20do=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20[[=20-r=20$i=20]]=20&&=20config+=3D("$i");=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20done;=20=20=20=20=20fi;=20=20=20=20=20local=20reset?= =?UTF-8?q?=3D$(shopt=20-po=20noglob);=20=20=20=20=20set=20-o=20noglob;=20?= =?UTF-8?q?=20=20=20=20if=20((${#config[@]}=20>=200));=20then=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20for=20i=20in=20"${config[@]}";=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20do=20=20=20=20=20=20=20=20=20=20=20=20=20=5Fincluded?= =?UTF-8?q?=5Fssh=5Fconfig=5Ffiles=20"$i";=20=20=20=20=20=20=20=20=20done;?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20if=20((${#config[@]}=20>=200))?= =?UTF-8?q?;=20then=20=20=20=20=20=20=20=20=20local=20IFS=3D'=20';=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20tmpkh=3D($(awk=20'sub("^[=20\t]*([Gg][Ll][?= =?UTF-8?q?Oo][Bb][Aa][Ll]|[Uu][Ss][Ee][Rr])[Kk][Nn][Oo][Ww][Nn][Hh][Oo][S?= =?UTF-8?q?s][Tt][Ss][Ff][Ii][Ll][Ee][=20\t]+",=20"")=20{=20print=20$0=20}?= =?UTF-8?q?'=20"${config[@]}"=20|=20sort=20-u));=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20IFS=3D$ifs;=20=20=20=20=20fi;=20=20=20=20=20if=20((${#tmpkh[?= =?UTF-8?q?@]}=20!=3D=200));=20then=20=20=20=20=20=20=20=20=20local=20j;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20for=20i=20in=20"${tmpkh[@]}";=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20do=20=20=20=20=20=20=20=20=20=20=20=20=20w?= =?UTF-8?q?hile=20[[=20$i=20=3D~=20^([^\"]*)\"([^\"]*)\"(.*)$=20]];=20do?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20i=3D${BASH?= =?UTF-8?q?=5FREMATCH[1]}${BASH=5FREMATCH[3]};=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20j=3D${BASH=5FREMATCH[2]};=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=5F=5Fexpand=5Ftilde=5Fb?= =?UTF-8?q?y=5Fref=20j;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?[[=20-r=20$j=20]]=20&&=20kh+=3D("$j");=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20done;=20=20=20=20=20=20=20=20=20=20=20=20=20for?= =?UTF-8?q?=20j=20in=20$i;=20=20=20=20=20=20=20=20=20=20=20=20=20do=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=5F=5Fexpand=5Ftil?= =?UTF-8?q?de=5Fby=5Fref=20j;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20[[=20-r=20$j=20]]=20&&=20kh+=3D("$j");=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20done;=20=20=20=20=20=20=20=20=20done;=20?= =?UTF-8?q?=20=20=20=20fi;=20=20=20=20=20if=20[[=20!=20-v=20configfile=20]?= =?UTF-8?q?];=20then=20=20=20=20=20=20=20=20=20for=20i=20in=20/etc/ssh/ssh?= =?UTF-8?q?=5Fknown=5Fhosts=20/etc/ssh/ssh=5Fknown=5Fhosts2=20/etc/known?= =?UTF-8?q?=5Fhosts=20/etc/known=5Fhosts2=20~/.ssh/known=5Fhosts=20~/.ssh/?= =?UTF-8?q?known=5Fhosts2;=20=20=20=20=20=20=20=20=20do=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20[[=20-r=20$i=20]]=20&&=20kh+=3D("$i");=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20done;=20=20=20=20=20=20=20=20=20for=20i?= =?UTF-8?q?=20in=20/etc/ssh2/knownhosts=20~/.ssh2/hostkeys;=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20do=20=20=20=20=20=20=20=20=20=20=20=20=20[[=20-d=20?= =?UTF-8?q?$i=20]]=20&&=20khd+=3D("$i"/*pub);=20=20=20=20=20=20=20=20=20do?= =?UTF-8?q?ne;=20=20=20=20=20fi;=20=20=20=20=20if=20((${#kh[@]}=20+=20${#k?= =?UTF-8?q?hd[@]}=20>=200));=20then=20=20=20=20=20=20=20=20=20if=20((${#kh?= =?UTF-8?q?[@]}=20>=200));=20then=20=20=20=20=20=20=20=20=20=20=20=20=20fo?= =?UTF-8?q?r=20i=20in=20"${kh[@]}";=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?do=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20while=20re?= =?UTF-8?q?ad=20-ra=20tmpkh;=20do=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20((${#tmpkh[@]}=20=3D=3D=200))=20&&=20co?= =?UTF-8?q?ntinue;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20set=20--=20"${tmpkh[@]}";=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20[[=20$1=20=3D=3D=20[\|\#]*?= =?UTF-8?q?=20]]=20&&=20continue;=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20[[=20$1=20=3D=3D=20@*=20]]=20&&=20shift?= =?UTF-8?q?;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20local=20IFS=3D,;=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20for=20host=20in=20$1;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20do=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20[[=20$?= =?UTF-8?q?host=20=3D=3D=20*[*=3F]*=20]]=20&&=20continue;=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20hos?= =?UTF-8?q?t=3D"${host#[}";=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20host=3D"${host%]=3F(:+([0-9]))}";?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20COMPREPLY+=3D($host);=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20done;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20IFS=3D$ifs;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20done=20<=20"$i";=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20done;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20'${COMPREPLY[@]}'?= =?UTF-8?q?=20--=20"$cur"));=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20if=20((${#khd[@]}=20>=200));=20then=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20for=20i=20in=20"${khd[@]}";=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20do=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20if=20[[=20$i=20=3D=3D=20*key=5F22=5F$cur*.pub?= =?UTF-8?q?=20&&=20-r=20$i=20]];=20then=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20host=3D${i/#*key=5F22=5F/};=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20host?= =?UTF-8?q?=3D${host/%.pub/};=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20COMPREPLY+=3D($host);=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20done;=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20for=20i=20in=20${!COMPREPLY[*]};=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20do=20=20=20=20=20=20=20=20=20=20=20=20=20COMPREPLY[i]=3D$pre?= =?UTF-8?q?fix${COMPREPLY[i]}$suffix;=20=20=20=20=20=20=20=20=20done;=20?= =?UTF-8?q?=20=20=20=20fi;=20=20=20=20=20if=20[[=20${#config[@]}=20-gt=200?= =?UTF-8?q?=20&&=20-v=20aliases=20]];=20then=20=20=20=20=20=20=20=20=20loc?= =?UTF-8?q?al=20-a=20hosts=3D($(command=20sed=20-ne=20's/^[[:blank:]]*[Hh]?= =?UTF-8?q?[Oo][Ss][Tt][[:blank:]]\(.*\)$/\1/p'=20"${config[@]}"));=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20if=20((${#hosts[@]}=20!=3D=200));=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20COMPREPLY+=3D($(compgen?= =?UTF-8?q?=20-P=20"$prefix"=20-S=20"$suffix"=20-W=20'${hosts[@]%%[*=3F%]*?= =?UTF-8?q?}'=20-X=20'\!*'=20--=20"$cur"));=20=20=20=20=20=20=20=20=20fi;?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20if=20[[=20-n=20${COMP=5FKNOWN?= =?UTF-8?q?=5FHOSTS=5FWITH=5FAVAHI-}=20]]=20&&=20type=20avahi-browse=20&>?= =?UTF-8?q?=20/dev/null;=20then=20=20=20=20=20=20=20=20=20COMPREPLY+=3D($(?= =?UTF-8?q?compgen=20-P=20"$prefix"=20-S=20"$suffix"=20-W=20"$(avahi-brows?= =?UTF-8?q?e=20-cpr=20=5Fworkstation.=5Ftcp=202>=20/dev/null=20|=20awk=20-?= =?UTF-8?q?F';'=20'/^=3D/=20{=20print=20$7=20}'=20|=20sort=20-u)"=20--=20"?= =?UTF-8?q?$cur"));=20=20=20=20=20fi;=20=20=20=20=20if=20type=20ruptime=20?= =?UTF-8?q?&>=20/dev/null;=20then=20=20=20=20=20=20=20=20=20COMPREPLY+=3D(?= =?UTF-8?q?$(compgen=20-W=20"$(ruptime=202>=20/dev/null=20|=20awk=20'!/^ru?= =?UTF-8?q?ptime:/=20{=20print=20$1=20}')"=20--=20"$cur"));=20=20=20=20=20?= =?UTF-8?q?fi;=20=20=20=20=20if=20[[=20-n=20${COMP=5FKNOWN=5FHOSTS=5FWITH?= =?UTF-8?q?=5FHOSTFILE-1}=20]];=20then=20=20=20=20=20=20=20=20=20COMPREPLY?= =?UTF-8?q?+=3D($(compgen=20-A=20hostname=20-P=20"$prefix"=20-S=20"$suffix?= =?UTF-8?q?"=20--=20"$cur"));=20=20=20=20=20fi;=20=20=20=20=20$reset;=20?= =?UTF-8?q?=20=20=20=20if=20[[=20-v=20ipv4=20]];=20then=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20COMPREPLY=3D("${COMPREPLY[@]/*:*$suffix/}");=20=20=20?= =?UTF-8?q?=20=20fi;=20=20=20=20=20if=20[[=20-v=20ipv6=20]];=20then=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20COMPREPLY=3D("${COMPREPLY[@]/+([0-9]).+([0?= =?UTF-8?q?-9]).+([0-9]).+([0-9])$suffix/}");=20=20=20=20=20fi;=20=20=20?= =?UTF-8?q?=20=20if=20[[=20-v=20ipv4=20||=20-v=20ipv6=20]];=20then=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20for=20i=20in=20"${!COMPREPLY[@]}";=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20do=20=20=20=20=20=20=20=20=20=20=20=20=20[?= =?UTF-8?q?[=20-n=20${COMPREPLY[i]}=20]]=20||=20unset=20-v=20"COMPREPLY[i]?= =?UTF-8?q?";=20=20=20=20=20=20=20=20=20done;=20=20=20=20=20fi;=20=20=20?= =?UTF-8?q?=20=20=5F=5Fltrim=5Fcolon=5Fcompletions=20"$prefix$cur"=20}=20?= =?UTF-8?q?=5Flongopt=20()=20{=20=20=20=20=20local=20cur=20prev=20words=20?= =?UTF-8?q?cword=20split;=20=20=20=20=20=5Finit=5Fcompletion=20-s=20||=20r?= =?UTF-8?q?eturn;=20=20=20=20=20case=20"${prev,,}"=20in=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20--help=20|=20--usage=20|=20--version)=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20return=20=20=20=20=20=20=20=20=20;;=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20--!(no-*)dir*)=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=5Ffiledir=20-d;=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20return=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20--!(no-*)@(file|path)*)=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=5Ffiledir;=20=20=20=20=20=20=20=20=20=20=20=20=20retu?= =?UTF-8?q?rn=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20--+([?= =?UTF-8?q?-a-z0-9=5F]))=20=20=20=20=20=20=20=20=20=20=20=20=20local=20arg?= =?UTF-8?q?type=3D$(LC=5FALL=3DC=20$1=20--help=202>&1=20|=20command=20sed?= =?UTF-8?q?=20-ne=20"s|.*$prev\[\{0,1\}=3D[<[]\{0,1\}\([-A-Za-z0-9=5F]\{1,?= =?UTF-8?q?\}\).*|\1|p");=20=20=20=20=20=20=20=20=20=20=20=20=20case=20${a?= =?UTF-8?q?rgtype,,}=20in=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20*dir*)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=5Ffiledir=20-d;=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20return=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20*file*=20|=20*path*)=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=5Ffiledir;=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20return=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20esac=20=20=20=20=20=20=20=20=20;;=20=20=20=20?= =?UTF-8?q?=20esac;=20=20=20=20=20$split=20&&=20return;=20=20=20=20=20if?= =?UTF-8?q?=20[[=20$cur=20=3D=3D=20-*=20]];=20then=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20COMPREPLY=3D($(compgen=20-W=20"$(LC=5FALL=3DC=20$1=20--help?= =?UTF-8?q?=202>&1=20|=20while=20read=20-r=20line;=20do=20=20=20=20=20[[?= =?UTF-8?q?=20$line=20=3D~=20--[A-Za-z0-9]+([-=5F][A-Za-z0-9]+)*=3D=3F=20]?= =?UTF-8?q?]=20&&=20printf=20'%s\n'=20${BASH=5FREMATCH[0]};=20done)"=20--?= =?UTF-8?q?=20"$cur"));=20=20=20=20=20=20=20=20=20[[=20${COMPREPLY-}=20=3D?= =?UTF-8?q?=3D=20*=3D=20]]=20&&=20compopt=20-o=20nospace;=20=20=20=20=20el?= =?UTF-8?q?se=20=20=20=20=20=20=20=20=20if=20[[=20$1=20=3D=3D=20*@(rmdir|c?= =?UTF-8?q?hroot)=20]];=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=5Ffi?= =?UTF-8?q?ledir=20-d;=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20[[=20$1=20=3D=3D=20*mkdir=20]]=20&&=20compopt?= =?UTF-8?q?=20-o=20nospace;=20=20=20=20=20=20=20=20=20=20=20=20=20=5Ffiled?= =?UTF-8?q?ir;=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20fi=20}=20=5Fmac?= =?UTF-8?q?=5Faddresses=20()=20{=20=20=20=20=20local=20re=3D'\([A-Fa-f0-9]?= =?UTF-8?q?\{2\}:\)\{5\}[A-Fa-f0-9]\{2\}';=20=20=20=20=20local=20PATH=3D"$?= =?UTF-8?q?PATH:/sbin:/usr/sbin";=20=20=20=20=20COMPREPLY+=3D($({=20LC=5FA?= =?UTF-8?q?LL=3DC=20ifconfig=20-a=20||=20ip=20link=20show;=20}=202>=20/dev?= =?UTF-8?q?/null=20|=20command=20sed=20-ne=20"s/.*[[:space:]]HWaddr[[:spac?= =?UTF-8?q?e:]]\{1,\}\($re\)[[:space:]].*/\1/p"=20-ne=20"s/.*[[:space:]]HW?= =?UTF-8?q?addr[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p"=20-ne=20"s|.*[[?= =?UTF-8?q?:space:]]\(link/\)\{0,1\}ether[[:space:]]\{1,\}\($re\)[[:space:?= =?UTF-8?q?]].*|\2|p"=20-ne=20"s|.*[[:space:]]\(link/\)\{0,1\}ether[[:spac?= =?UTF-8?q?e:]]\{1,\}\($re\)[[:space:]]*$|\2|p"));=20=20=20=20=20COMPREPLY?= =?UTF-8?q?+=3D($({=20arp=20-an=20||=20ip=20neigh=20show;=20}=202>=20/dev/?= =?UTF-8?q?null=20|=20command=20sed=20-ne=20"s/.*[[:space:]]\($re\)[[:spac?= =?UTF-8?q?e:]].*/\1/p"=20-ne=20"s/.*[[:space:]]\($re\)[[:space:]]*$/\1/p"?= =?UTF-8?q?));=20=20=20=20=20COMPREPLY+=3D($(command=20sed=20-ne=20"s/^[[:?= =?UTF-8?q?space:]]*\($re\)[[:space:]].*/\1/p"=20/etc/ethers=202>=20/dev/n?= =?UTF-8?q?ull));=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20'${COMPREPLY?= =?UTF-8?q?[@]}'=20--=20"$cur"));=20=20=20=20=20=5F=5Fltrim=5Fcolon=5Fcomp?= =?UTF-8?q?letions=20"$cur"=20}=20=5Fminimal=20()=20{=20=20=20=20=20local?= =?UTF-8?q?=20cur=20prev=20words=20cword=20split;=20=20=20=20=20=5Finit=5F?= =?UTF-8?q?completion=20-s=20||=20return;=20=20=20=20=20$split=20&&=20retu?= =?UTF-8?q?rn;=20=20=20=20=20=5Ffiledir=20}=20=5Fmodules=20()=20{=20=20=20?= =?UTF-8?q?=20=20local=20modpath;=20=20=20=20=20modpath=3D/lib/modules/$1;?= =?UTF-8?q?=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20"$(command=20ls=20?= =?UTF-8?q?-RL=20$modpath=202>=20/dev/null=20|=20command=20sed=20-ne=20's/?= =?UTF-8?q?^\(.*\)\.k\{0,1\}o\(\.[gx]z\)\{0,1\}$/\1/p')"=20--=20"$cur"))?= =?UTF-8?q?=20}=20=5Fncpus=20()=20{=20=20=20=20=20local=20var=3DNPROCESSOR?= =?UTF-8?q?S=5FONLN;=20=20=20=20=20[[=20$OSTYPE=20=3D=3D=20*linux*=20]]=20?= =?UTF-8?q?&&=20var=3D=5F$var;=20=20=20=20=20local=20n=3D$(getconf=20$var?= =?UTF-8?q?=202>=20/dev/null);=20=20=20=20=20printf=20%s=20${n:-1}=20}=20?= =?UTF-8?q?=5Fparse=5Fhelp=20()=20{=20=20=20=20=20eval=20local=20cmd=3D"$(?= =?UTF-8?q?quote=20"$1")";=20=20=20=20=20local=20line;=20=20=20=20=20{=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20case=20$cmd=20in=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20-)=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20cat=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20*)=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20LC=5FALL=3DC=20"$(dequote=20"$cmd")"=20${2?= =?UTF-8?q?:---help}=202>&1=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20esac=20=20=20=20=20}=20|=20while=20read=20?= =?UTF-8?q?-r=20line;=20do=20=20=20=20=20=20=20=20=20[[=20$line=20=3D=3D?= =?UTF-8?q?=20*([[:blank:]])-*=20]]=20||=20continue;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20while=20[[=20$line=20=3D~=20((^|[^-])-[A-Za-z0-9=3F][[:sp?= =?UTF-8?q?ace:]]+)\[=3F[A-Z0-9]+([,=5F-]+[A-Z0-9]+)=3F(\.\.+)=3F\]=3F=20]?= =?UTF-8?q?];=20do=20=20=20=20=20=20=20=20=20=20=20=20=20line=3D${line/"${?= =?UTF-8?q?BASH=5FREMATCH[0]}"/"${BASH=5FREMATCH[1]}"};=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20done;=20=20=20=20=20=20=20=20=20=5F=5Fparse=5Foptions?= =?UTF-8?q?=20"${line//=20or=20/,=20}";=20=20=20=20=20done=20}=20=5Fparse?= =?UTF-8?q?=5Fusage=20()=20{=20=20=20=20=20eval=20local=20cmd=3D"$(quote?= =?UTF-8?q?=20"$1")";=20=20=20=20=20local=20line=20match=20option=20i=20ch?= =?UTF-8?q?ar;=20=20=20=20=20{=20=20=20=20=20=20=20=20=20case=20$cmd=20in?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20-)=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20cat=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20*)=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20LC=5FALL=3DC=20"$(deq?= =?UTF-8?q?uote=20"$cmd")"=20${2:---usage}=202>&1=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20esac=20=20=20=20=20?= =?UTF-8?q?}=20|=20while=20read=20-r=20line;=20do=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20while=20[[=20$line=20=3D~=20\[[[:space:]]*(-[^]]+)[[:space:]?= =?UTF-8?q?]*\]=20]];=20do=20=20=20=20=20=20=20=20=20=20=20=20=20match=3D$?= =?UTF-8?q?{BASH=5FREMATCH[0]};=20=20=20=20=20=20=20=20=20=20=20=20=20opti?= =?UTF-8?q?on=3D${BASH=5FREMATCH[1]};=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20case=20$option=20in=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20-=3F(\[)+([a-zA-Z0-9=3F]))=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20for=20((i=20=3D=201;=20i?= =?UTF-8?q?=20<=20${#option};=20i++))=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20do=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20char=3D${option:i:1};?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20[[=20$char=20!=3D=20'['=20]]=20&&=20printf=20'%s\n'?= =?UTF-8?q?=20-$char;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20done=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20*)?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=5F=5Fparse=5Foptions=20"$option"=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20=20=20=20=20e?= =?UTF-8?q?sac;=20=20=20=20=20=20=20=20=20=20=20=20=20line=3D${line#*"$mat?= =?UTF-8?q?ch"};=20=20=20=20=20=20=20=20=20done;=20=20=20=20=20done=20}=20?= =?UTF-8?q?=5Fpci=5Fids=20()=20{=20=20=20=20=20COMPREPLY+=3D($(compgen=20-?= =?UTF-8?q?W=20"$(PATH=3D"$PATH:/sbin"=20lspci=20-n=20|=20awk=20'{print=20?= =?UTF-8?q?$3}')"=20--=20"$cur"))=20}=20=5Fpgids=20()=20{=20=20=20=20=20CO?= =?UTF-8?q?MPREPLY=3D($(compgen=20-W=20'$(command=20ps=20axo=20pgid=3D)'?= =?UTF-8?q?=20--=20"$cur"))=20}=20=5Fpids=20()=20{=20=20=20=20=20COMPREPLY?= =?UTF-8?q?=3D($(compgen=20-W=20'$(command=20ps=20axo=20pid=3D)'=20--=20"$?= =?UTF-8?q?cur"))=20}=20=5Fpnames=20()=20{=20=20=20=20=20local=20-a=20proc?= =?UTF-8?q?s;=20=20=20=20=20if=20[[=20${1-}=20=3D=3D=20-s=20]];=20then=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20procs=3D($(command=20ps=20axo=20comm=20?= =?UTF-8?q?|=20command=20sed=20-e=201d));=20=20=20=20=20else=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20local=20line=20i=3D-1=20ifs=3D$IFS;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20IFS=3D'=20';=20=20=20=20=20=20=20=20=20local=20-?= =?UTF-8?q?a=20psout=3D($(command=20ps=20axo=20command=3D));=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20IFS=3D$ifs;=20=20=20=20=20=20=20=20=20for=20line?= =?UTF-8?q?=20in=20"${psout[@]}";=20=20=20=20=20=20=20=20=20do=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20if=20((i=20=3D=3D=20-1));=20then=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20if=20[[=20$line?= =?UTF-8?q?=20=3D~=20^(.*[[:space:]])COMMAND([[:space:]]|$)=20]];=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?i=3D${#BASH=5FREMATCH[1]};=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20break;=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20=20=20=20=20else?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20line=3D${lin?= =?UTF-8?q?e:i};=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20line=3D?= =?UTF-8?q?${line%%=20*};=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20procs+=3D($line);=20=20=20=20=20=20=20=20=20=20=20=20=20fi;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20done;=20=20=20=20=20=20=20=20=20if?= =?UTF-8?q?=20((i=20=3D=3D=20-1));=20then=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20for=20line=20in=20"${psout[@]}";=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20do=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20if=20[[=20$line=20=3D~=20^[[(](.+)[])]$=20]];=20then=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20pro?= =?UTF-8?q?cs+=3D(${BASH=5FREMATCH[1]});=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20line=3D${line%%=20*};=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20line=3D${line##@(*?= =?UTF-8?q?/|-)};=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20procs+=3D($line);=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20fi;=20=20=20=20=20=20=20=20=20=20=20=20=20done;=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20fi;=20=20=20=20=20fi;=20=20=20=20=20COM?= =?UTF-8?q?PREPLY=3D($(compgen=20-X=20""=20-W=20'${procs[@]}'=20-?= =?UTF-8?q?-=20"$cur"))=20}=20=5Fquote=5Freadline=5Fby=5Fref=20()=20{=20?= =?UTF-8?q?=20=20=20=20if=20[[=20$1=20=3D=3D=20\'*=20]];=20then=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20printf=20-v=20$2=20%s=20"${1:1}";=20=20=20=20?= =?UTF-8?q?=20else=20=20=20=20=20=20=20=20=20printf=20-v=20$2=20%q=20"$1";?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20[[=20${!2}=20=3D=3D=20\$*=20]]?= =?UTF-8?q?=20&&=20eval=20$2=3D${!2}=20}=20=5Frealcommand=20()=20{=20=20?= =?UTF-8?q?=20=20=20type=20-P=20"$1"=20>=20/dev/null=20&&=20{=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20if=20type=20-p=20realpath=20>=20/dev/null;=20the?= =?UTF-8?q?n=20=20=20=20=20=20=20=20=20=20=20=20=20realpath=20"$(type=20-P?= =?UTF-8?q?=20"$1")";=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20if=20type=20-p=20greadlink=20>=20/dev/null;?= =?UTF-8?q?=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20gread?= =?UTF-8?q?link=20-f=20"$(type=20-P=20"$1")";=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20if=20type=20-p=20readlink=20>=20/dev/null;=20then=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20readli?= =?UTF-8?q?nk=20-f=20"$(type=20-P=20"$1")";=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20type=20-P=20"$1";=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20fi;=20=20=20=20=20=20=20=20=20fi=20=20=20=20=20}=20?= =?UTF-8?q?}=20=5Frl=5Fenabled=20()=20{=20=20=20=20=20[[=20"$(bind=20-v)"?= =?UTF-8?q?=20=3D=3D=20*$1+([[:space:]])on*=20]]=20}=20=5Froot=5Fcommand?= =?UTF-8?q?=20()=20{=20=20=20=20=20local=20PATH=3D$PATH:/sbin:/usr/sbin:/u?= =?UTF-8?q?sr/local/sbin;=20=20=20=20=20local=20root=5Fcommand=3D$1;=20=20?= =?UTF-8?q?=20=20=20=5Fcommand=20}=20=5Fservice=20()=20{=20=20=20=20=20loc?= =?UTF-8?q?al=20cur=20prev=20words=20cword;=20=20=20=20=20=5Finit=5Fcomple?= =?UTF-8?q?tion=20||=20return;=20=20=20=20=20((cword=20>=202))=20&&=20retu?= =?UTF-8?q?rn;=20=20=20=20=20if=20[[=20$cword=20-eq=201=20&&=20$prev=20=3D?= =?UTF-8?q?=3D=20=3F(*/)service=20]];=20then=20=20=20=20=20=20=20=20=20=5F?= =?UTF-8?q?services;=20=20=20=20=20=20=20=20=20[[=20-e=20/etc/mandrake-rel?= =?UTF-8?q?ease=20]]=20&&=20=5Fxinetd=5Fservices;=20=20=20=20=20else=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20local=20sysvdirs;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=5Fsysvdirs;=20=20=20=20=20=20=20=20=20COMPREPLY=3D($(compge?= =?UTF-8?q?n=20-W=20'`command=20sed=20-e=20"y/|/=20/"=20\=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20-ne=20"s/^.*\(U\|msg=5Fu\)sage.*{\(.*\)?= =?UTF-8?q?}.*$/\2/p"=20\=20=20=20=20=20=20=20=20=20=20=20=20=20${sysvdirs?= =?UTF-8?q?[0]}/${prev##*/}=202>/dev/null`=20start=20stop'=20--=20"$cur"))?= =?UTF-8?q?;=20=20=20=20=20fi=20}=20=5Fservices=20()=20{=20=20=20=20=20loc?= =?UTF-8?q?al=20sysvdirs;=20=20=20=20=20=5Fsysvdirs;=20=20=20=20=20local?= =?UTF-8?q?=20IFS=3D'=20'=20reset=3D$(shopt=20-p=20nullglob);=20=20=20=20?= =?UTF-8?q?=20shopt=20-s=20nullglob;=20=20=20=20=20COMPREPLY=3D($(printf?= =?UTF-8?q?=20'%s\n'=20${sysvdirs[0]}/!($=5Fbackup=5Fglob|functions|README?= =?UTF-8?q?)));=20=20=20=20=20$reset;=20=20=20=20=20COMPREPLY+=3D($({=20sy?= =?UTF-8?q?stemctl=20list-units=20--full=20--all=20||=20systemctl=20list-u?= =?UTF-8?q?nit-files;=20}=202>=20/dev/null=20|=20awk=20'$1=20~=20/\.servic?= =?UTF-8?q?e$/=20{=20sub("\\.service$",=20"",=20$1);=20print=20$1=20}'));?= =?UTF-8?q?=20=20=20=20=20if=20[[=20-x=20/sbin/upstart-udev-bridge=20]];?= =?UTF-8?q?=20then=20=20=20=20=20=20=20=20=20COMPREPLY+=3D($(initctl=20lis?= =?UTF-8?q?t=202>=20/dev/null=20|=20cut=20-d'=20'=20-f1));=20=20=20=20=20f?= =?UTF-8?q?i;=20=20=20=20=20COMPREPLY=3D($(compgen=20-W=20'${COMPREPLY[@]#?= =?UTF-8?q?${sysvdirs[0]}/}'=20--=20"$cur"))=20}=20=5Fshells=20()=20{=20?= =?UTF-8?q?=20=20=20=20local=20shell=20rest;=20=20=20=20=20while=20read=20?= =?UTF-8?q?-r=20shell=20rest;=20do=20=20=20=20=20=20=20=20=20[[=20$shell?= =?UTF-8?q?=20=3D=3D=20/*=20&&=20$shell=20=3D=3D=20"$cur"*=20]]=20&&=20COM?= =?UTF-8?q?PREPLY+=3D($shell);=20=20=20=20=20done=202>=20/dev/null=20<=20/?= =?UTF-8?q?etc/shells=20}=20=5Fsignals=20()=20{=20=20=20=20=20local=20-a?= =?UTF-8?q?=20sigs=3D($(compgen=20-P=20"${1-}"=20-A=20signal=20"SIG${cur#$?= =?UTF-8?q?{1-}}"));=20=20=20=20=20COMPREPLY+=3D("${sigs[@]/#${1-}SIG/${1-?= =?UTF-8?q?}}")=20}=20=5Fsplit=5Flongopt=20()=20{=20=20=20=20=20if=20[[=20?= =?UTF-8?q?$cur=20=3D=3D=20--=3F*=3D*=20]];=20then=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20prev=3D"${cur%%=3F(\\)=3D*}";=20=20=20=20=20=20=20=20=20cur?= =?UTF-8?q?=3D"${cur#*=3D}";=20=20=20=20=20=20=20=20=20return=200;=20=20?= =?UTF-8?q?=20=20=20fi;=20=20=20=20=20return=201=20}=20=5Fsysvdirs=20()=20?= =?UTF-8?q?{=20=20=20=20=20sysvdirs=3D();=20=20=20=20=20[[=20-d=20/etc/rc.?= =?UTF-8?q?d/init.d=20]]=20&&=20sysvdirs+=3D(/etc/rc.d/init.d);=20=20=20?= =?UTF-8?q?=20=20[[=20-d=20/etc/init.d=20]]=20&&=20sysvdirs+=3D(/etc/init.?= =?UTF-8?q?d);=20=20=20=20=20[[=20-f=20/etc/slackware-version=20]]=20&&=20?= =?UTF-8?q?sysvdirs=3D(/etc/rc.d);=20=20=20=20=20return=200=20}=20=5Fterms?= =?UTF-8?q?=20()=20{=20=20=20=20=20COMPREPLY+=3D($(compgen=20-W=20"$({=20c?= =?UTF-8?q?ommand=20sed=20-ne=20's/^\([^[:space:]#|]\{2,\}\)|.*/\1/p'=20/e?= =?UTF-8?q?tc/termcap=20{=20toe=20-a=20||=20toe;=20}=20|=20awk=20'{=20prin?= =?UTF-8?q?t=20$1=20}'=20find=20/{etc,lib,usr/lib,usr/share}/terminfo/=3F?= =?UTF-8?q?=20-type=20f=20-maxdepth=201=20|=20awk=20-F/=20'{=20print=20$NF?= =?UTF-8?q?=20}';=20}=202>=20/dev/null)"=20--=20"$cur"))=20}=20=5Ftilde=20?= =?UTF-8?q?()=20{=20=20=20=20=20local=20result=3D0;=20=20=20=20=20if=20[[?= =?UTF-8?q?=20${1-}=20=3D=3D=20\~*=20&&=20$1=20!=3D=20*/*=20]];=20then=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20COMPREPLY=3D($(compgen=20-P=20'~'=20-u?= =?UTF-8?q?=20--=20"${1#\~}"));=20=20=20=20=20=20=20=20=20result=3D${#COMP?= =?UTF-8?q?REPLY[@]};=20=20=20=20=20=20=20=20=20((result=20>=200))=20&&=20?= =?UTF-8?q?compopt=20-o=20filenames=202>=20/dev/null;=20=20=20=20=20fi;=20?= =?UTF-8?q?=20=20=20=20return=20$result=20}=20=5Fuids=20()=20{=20=20=20=20?= =?UTF-8?q?=20if=20type=20getent=20&>=20/dev/null;=20then=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20COMPREPLY=3D($(compgen=20-W=20'$(getent=20passwd=20?= =?UTF-8?q?|=20cut=20-d:=20-f3)'=20--=20"$cur"));=20=20=20=20=20else=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20if=20type=20perl=20&>=20/dev/null;=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20COMPREPLY=3D($(compgen?= =?UTF-8?q?=20-W=20'$(perl=20-e=20'"'"'while=20(($uid)=20=3D=20(getpwent)[?= =?UTF-8?q?2])=20{=20print=20$uid=20.=20"\n"=20}'"'"')'=20--=20"$cur"));?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20COMPREPLY=3D($(compgen=20-W=20'$(cut=20-d:=20-f3=20/et?= =?UTF-8?q?c/passwd)'=20--=20"$cur"));=20=20=20=20=20=20=20=20=20fi;=20=20?= =?UTF-8?q?=20=20=20fi=20}=20=5Fupvar=20()=20{=20=20=20=20=20echo=20"bash?= =?UTF-8?q?=5Fcompletion:=20$FUNCNAME:=20deprecated=20function,"=20"use=20?= =?UTF-8?q?=5Fupvars=20instead"=201>&2;=20=20=20=20=20if=20unset=20-v=20"$?= =?UTF-8?q?1";=20then=20=20=20=20=20=20=20=20=20if=20(($#=20=3D=3D=202));?= =?UTF-8?q?=20then=20=20=20=20=20=20=20=20=20=20=20=20=20eval=20$1=3D\"\$2?= =?UTF-8?q?\";=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20eval=20$1=3D\(\"\$"{@:2}"\"\);=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20fi;=20=20=20=20=20fi=20}=20=5Fupvars=20()=20{=20=20=20=20?= =?UTF-8?q?=20if=20!=20(($#));=20then=20=20=20=20=20=20=20=20=20echo=20"ba?= =?UTF-8?q?sh=5Fcompletion:=20$FUNCNAME:=20usage:=20$FUNCNAME"=20"[-v=20va?= =?UTF-8?q?rname=20value]=20|=20[-aN=20varname=20[value=20...]]=20..."=201?= =?UTF-8?q?>&2;=20=20=20=20=20=20=20=20=20return=202;=20=20=20=20=20fi;=20?= =?UTF-8?q?=20=20=20=20while=20(($#));=20do=20=20=20=20=20=20=20=20=20case?= =?UTF-8?q?=20$1=20in=20=20=20=20=20=20=20=20=20=20=20=20=20-a*)=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20[[=20-n=20${1#-a}=20]?= =?UTF-8?q?]=20||=20{=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20echo=20"bash=5Fcompletion:=20$FUNCNAME:"=20"\`$1':?= =?UTF-8?q?=20missing=20number=20specifier"=201>&2;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20return=201=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20};=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20printf=20%d=20"${1#-a}"=20&>?= =?UTF-8?q?=20/dev/null=20||=20{=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20echo=20bash=5Fcompletion:=20"$FUNCNAME:=20?= =?UTF-8?q?\`$1':=20invalid=20number=20specifier"=201>&2;=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20return=201=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20};=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20[[=20-n=20"$2"=20]]=20&&?= =?UTF-8?q?=20unset=20-v=20"$2"=20&&=20eval=20$2=3D\(\"\$"{@:3:${1#-a}}"\"?= =?UTF-8?q?\)=20&&=20shift=20$((${1#-a}=20+=202))=20||=20{=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20echo=20bash=5Fc?= =?UTF-8?q?ompletion:=20"$FUNCNAME:=20\`$1${2+=20}$2':=20missing=20argumen?= =?UTF-8?q?t(s)"=201>&2;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20return=201=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20}=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20-v)=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20[[=20-n=20"$2"=20]]=20&&=20unset=20-v?= =?UTF-8?q?=20"$2"=20&&=20eval=20$2=3D\"\$3\"=20&&=20shift=203=20||=20{=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ech?= =?UTF-8?q?o=20"bash=5Fcompletion:=20$FUNCNAME:=20$1:"=20"missing=20argume?= =?UTF-8?q?nt(s)"=201>&2;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20return=201=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20}=20=20=20=20=20=20=20=20=20=20=20=20=20;;=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20*)=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20echo=20"bash=5Fcompletion:=20$FUNCNAME:?= =?UTF-8?q?=20$1:=20invalid=20option"=201>&2;=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20return=201=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20;;=20=20=20=20=20=20=20=20=20esac;=20=20=20=20=20do?= =?UTF-8?q?ne=20}=20=5Fusb=5Fids=20()=20{=20=20=20=20=20COMPREPLY+=3D($(co?= =?UTF-8?q?mpgen=20-W=20"$(PATH=3D"$PATH:/sbin"=20lsusb=20|=20awk=20'{prin?= =?UTF-8?q?t=20$6}')"=20--=20"$cur"))=20}=20=5Fuser=5Fat=5Fhost=20()=20{?= =?UTF-8?q?=20=20=20=20=20local=20cur=20prev=20words=20cword;=20=20=20=20?= =?UTF-8?q?=20=5Finit=5Fcompletion=20-n=20:=20||=20return;=20=20=20=20=20i?= =?UTF-8?q?f=20[[=20$cur=20=3D=3D=20*@*=20]];=20then=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=5Fknown=5Fhosts=5Freal=20"$cur";=20=20=20=20=20else=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20COMPREPLY=3D($(compgen=20-u=20-S=20@=20?= =?UTF-8?q?--=20"$cur"));=20=20=20=20=20=20=20=20=20compopt=20-o=20nospace?= =?UTF-8?q?;=20=20=20=20=20fi=20}=20=5Fusergroup=20()=20{=20=20=20=20=20if?= =?UTF-8?q?=20[[=20$cur=20=3D=3D=20*\\\\*=20||=20$cur=20=3D=3D=20*:*:*=20]?= =?UTF-8?q?];=20then=20=20=20=20=20=20=20=20=20return;=20=20=20=20=20else?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20if=20[[=20$cur=20=3D=3D=20*\\:*=20]]?= =?UTF-8?q?;=20then=20=20=20=20=20=20=20=20=20=20=20=20=20local=20prefix;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20prefix=3D${cur%%*([^:])}?= =?UTF-8?q?;=20=20=20=20=20=20=20=20=20=20=20=20=20prefix=3D${prefix//\\/}?= =?UTF-8?q?;=20=20=20=20=20=20=20=20=20=20=20=20=20local=20mycur=3D"${cur#?= =?UTF-8?q?*[:]}";=20=20=20=20=20=20=20=20=20=20=20=20=20if=20[[=20${1-}?= =?UTF-8?q?=20=3D=3D=20-u=20]];=20then=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=5Fallowed=5Fgroups=20"$mycur";=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20local=20IFS=3D'=20';=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20COMPREPLY=3D($(compgen=20-g=20--=20"?= =?UTF-8?q?$mycur"));=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20COMPREPLY=3D($(compgen=20-P=20"$p?= =?UTF-8?q?refix"=20-W=20"${COMPREPLY[@]}"));=20=20=20=20=20=20=20=20=20el?= =?UTF-8?q?se=20=20=20=20=20=20=20=20=20=20=20=20=20if=20[[=20$cur=20=3D?= =?UTF-8?q?=3D=20*:*=20]];=20then=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20local=20mycur=3D"${cur#*:}";=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20if=20[[=20${1-}=20=3D=3D=20-u=20]?= =?UTF-8?q?];=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=5Fallowed=5Fgroups=20"$mycur";=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20local=20IFS=3D'=20';=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20COMPRE?= =?UTF-8?q?PLY=3D($(compgen=20-g=20--=20"$mycur"));=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20if=20[[=20${1-}=20=3D=3D=20-u=20]];=20then=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=5Fallowed=5Fusers?= =?UTF-8?q?=20"$cur";=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20el?= =?UTF-8?q?se=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20local=20IFS=3D'=20';=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20COMPREPLY=3D($(compgen=20-u=20--=20"$cu?= =?UTF-8?q?r"));=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20fi;=20=20=20=20=20fi=20}=20=5Fuserland=20()=20{=20=20=20=20?= =?UTF-8?q?=20local=20userland=3D$(uname=20-s);=20=20=20=20=20[[=20$userla?= =?UTF-8?q?nd=20=3D=3D=20@(Linux|GNU/*)=20]]=20&&=20userland=3DGNU;=20=20?= =?UTF-8?q?=20=20=20[[=20$userland=20=3D=3D=20"$1"=20]]=20}=20=5Fvariable?= =?UTF-8?q?=5Fassignments=20()=20{=20=20=20=20=20local=20cur=3D${1-};=20?= =?UTF-8?q?=20=20=20=20if=20[[=20$cur=20=3D~=20^([A-Za-z=5F][A-Za-z0-9=5F]?= =?UTF-8?q?*)=3D(.*)$=20]];=20then=20=20=20=20=20=20=20=20=20prev=3D${BASH?= =?UTF-8?q?=5FREMATCH[1]};=20=20=20=20=20=20=20=20=20cur=3D${BASH=5FREMATC?= =?UTF-8?q?H[2]};=20=20=20=20=20else=20=20=20=20=20=20=20=20=20return=201;?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20case=20$prev=20in=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20TZ)=20=20=20=20=20=20=20=20=20=20=20=20=20cur=3D?= =?UTF-8?q?/usr/share/zoneinfo/$cur;=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=5Ffiledir;=20=20=20=20=20=20=20=20=20=20=20=20=20for=20i=20?= =?UTF-8?q?in=20"${!COMPREPLY[@]}";=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?do=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20if=20[[=20?= =?UTF-8?q?${COMPREPLY[i]}=20=3D=3D=20*.tab=20]];=20then=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20unset=20'COMPREPLY?= =?UTF-8?q?[i]';=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20continue;=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20else=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20if=20[[=20-d=20${COMPREPLY[i]}=20]];=20then=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20COMPREPLY[i]+=3D/;=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20compopt=20-o=20nospace;=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20COMPREPLY[i]=3D${COMPREP?= =?UTF-8?q?LY[i]#/usr/share/zoneinfo/};=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20done=20=20=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20TERM)=20=20=20=20=20=20=20=20=20=20=20=20=20=5Fterms=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20LANG=20|=20LC?= =?UTF-8?q?=5F*)=20=20=20=20=20=20=20=20=20=20=20=20=20COMPREPLY=3D($(comp?= =?UTF-8?q?gen=20-W=20'$(locale=20-a=202>/dev/null)'=20--=20"$cur"))=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20;;=20=20=20=20=20=20=20=20=20*)=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=5Fvariables=20&&=20return=200;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=5Ffiledir=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20;;=20=20=20=20=20esac;=20=20=20=20=20return=200?= =?UTF-8?q?=20}=20=5Fvariables=20()=20{=20=20=20=20=20if=20[[=20$cur=20=3D?= =?UTF-8?q?~=20^(\$(\{[!#]=3F)=3F)([A-Za-z0-9=5F]*)$=20]];=20then=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20if=20[[=20$cur=20=3D=3D=20'${'*=20]];=20then?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20local=20arrs=20vars;=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20vars=3D($(compgen=20-A=20va?= =?UTF-8?q?riable=20-P=20${BASH=5FREMATCH[1]}=20-S=20'}'=20--=20${BASH=5FR?= =?UTF-8?q?EMATCH[3]}));=20=20=20=20=20=20=20=20=20=20=20=20=20arrs=3D($(c?= =?UTF-8?q?ompgen=20-A=20arrayvar=20-P=20${BASH=5FREMATCH[1]}=20-S=20'['?= =?UTF-8?q?=20--=20${BASH=5FREMATCH[3]}));=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20if=20((${#vars[@]}=20=3D=3D=201=20&&=20${#arrs[@]}=20!?= =?UTF-8?q?=3D=200));=20then=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20compopt=20-o=20nospace;=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20COMPREPLY+=3D(${arrs[*]});=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20COMPREPLY+=3D(${vars[*]});=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20else=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20COMPREPLY+=3D($(compgen=20-A=20va?= =?UTF-8?q?riable=20-P=20'$'=20--=20"${BASH=5FREMATCH[3]}"));=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20return=200;=20=20?= =?UTF-8?q?=20=20=20else=20=20=20=20=20=20=20=20=20if=20[[=20$cur=20=3D~?= =?UTF-8?q?=20^(\$\{[#!]=3F)([A-Za-z0-9=5F]*)\[([^]]*)$=20]];=20then=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20local=20IFS=3D'=20';=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20COMPREPLY+=3D($(compgen=20-W=20'$?= =?UTF-8?q?(printf=20%s\\n=20"${!'${BASH=5FREMATCH[2]}'[@]}")'=20-P=20"${B?= =?UTF-8?q?ASH=5FREMATCH[1]}${BASH=5FREMATCH[2]}["=20-S=20']}'=20--=20"${B?= =?UTF-8?q?ASH=5FREMATCH[3]}"));=20=20=20=20=20=20=20=20=20=20=20=20=20if?= =?UTF-8?q?=20[[=20${BASH=5FREMATCH[3]}=20=3D=3D=20[@*]=20]];=20then=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20COMPREPLY+=3D("${B?= =?UTF-8?q?ASH=5FREMATCH[1]}${BASH=5FREMATCH[2]}[${BASH=5FREMATCH[3]}]}");?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=5F=5Fltrim=5Fcolon=5Fcompletions=20"$cur";?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20return=200;=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20else=20=20=20=20=20=20=20=20=20=20=20=20=20if=20?= =?UTF-8?q?[[=20$cur=20=3D~=20^\$\{[#!]=3F[A-Za-z0-9=5F]*\[.*\]$=20]];=20t?= =?UTF-8?q?hen=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20COMPREPLY?= =?UTF-8?q?+=3D("$cur}");=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=5F=5Fltrim=5Fcolon=5Fcompletions=20"$cur";=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20return=200;=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20fi;=20=20=20=20=20=20=20=20=20fi;=20=20?= =?UTF-8?q?=20=20=20fi;=20=20=20=20=20return=201=20}=20=5Fxfunc=20()=20{?= =?UTF-8?q?=20=20=20=20=20set=20--=20"$@";=20=20=20=20=20local=20srcfile?= =?UTF-8?q?=3D$1;=20=20=20=20=20shift;=20=20=20=20=20declare=20-F=20$1=20&?= =?UTF-8?q?>=20/dev/null=20||=20=5F=5Fload=5Fcompletion=20"$srcfile";=20?= =?UTF-8?q?=20=20=20=20"$@"=20}=20=5Fxinetd=5Fservices=20()=20{=20=20=20?= =?UTF-8?q?=20=20local=20xinetddir=3D${BASHCOMP=5FXINETDDIR:-/etc/xinetd.d?= =?UTF-8?q?};=20=20=20=20=20if=20[[=20-d=20$xinetddir=20]];=20then=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20local=20IFS=3D'=20'=20reset=3D$(shopt=20-p?= =?UTF-8?q?=20nullglob);=20=20=20=20=20=20=20=20=20shopt=20-s=20nullglob;?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20local=20-a=20svcs=3D($(printf=20'%s\?= =?UTF-8?q?n'=20$xinetddir/!($=5Fbackup=5Fglob)));=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20$reset;=20=20=20=20=20=20=20=20=20((!${#svcs[@]}))=20||=20CO?= =?UTF-8?q?MPREPLY+=3D($(compgen=20-W=20'${svcs[@]#$xinetddir/}'=20--=20"$?= =?UTF-8?q?{cur-}"));=20=20=20=20=20fi=20}=20command=5Fnot=5Ffound=5Fhandl?= =?UTF-8?q?e=20()=20{=20=20=20=20=20if=20[=20-x=20/usr/lib/command-not-fou?= =?UTF-8?q?nd=20];=20then=20=20=20=20=20=20=20=20=20/usr/lib/command-not-f?= =?UTF-8?q?ound=20--=20"$1";=20=20=20=20=20=20=20=20=20return=20$=3F;=20?= =?UTF-8?q?=20=20=20=20else=20=20=20=20=20=20=20=20=20if=20[=20-x=20/usr/s?= =?UTF-8?q?hare/command-not-found/command-not-found=20];=20then=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20/usr/share/command-not-found/comm?= =?UTF-8?q?and-not-found=20--=20"$1";=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20return=20$=3F;=20=20=20=20=20=20=20=20=20else=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20printf=20"%s:=20command=20not=20found\n?= =?UTF-8?q?"=20"$1"=201>&2;=20=20=20=20=20=20=20=20=20=20=20=20=20return?= =?UTF-8?q?=20127;=20=20=20=20=20=20=20=20=20fi;=20=20=20=20=20fi=20}=20de?= =?UTF-8?q?quote=20()=20{=20=20=20=20=20eval=20printf=20%s=20"$1"=202>=20/?= =?UTF-8?q?dev/null=20}=20quote=20()=20{=20=20=20=20=20local=20quoted=3D${?= =?UTF-8?q?1//\'/\'\\\'\'};=20=20=20=20=20printf=20"'%s'"=20"$quoted"=20}?= =?UTF-8?q?=20quote=5Freadline=20()=20{=20=20=20=20=20local=20ret;=20=20?= =?UTF-8?q?=20=20=20=5Fquote=5Freadline=5Fby=5Fref=20"$1"=20ret;=20=20=20?= =?UTF-8?q?=20=20printf=20%s=20"$ret"=20}=20tests.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +- CSharp/ErrorsManager.cs | 618 +++++++++++++++++++++++------------- CSharp/ErrorsManager.csproj | 22 +- CSharp/ErrorsManager.slnx | 3 + CSharp/Program.cs | 13 +- CSharp/Tests.cs | 241 ++++++++++++++ README.md | 189 ++++++++++- version | 2 +- 8 files changed, 844 insertions(+), 248 deletions(-) create mode 100644 CSharp/ErrorsManager.slnx create mode 100644 CSharp/Tests.cs diff --git a/.gitignore b/.gitignore index f3e6490..85249d3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ /Python/Abstracts/AnPMap.py /Python/Abstracts/Applications.py .sass-cache -__pycache__ \ No newline at end of file +__pycache__ +/CSharp/obj +/CSharp/bin \ No newline at end of file diff --git a/CSharp/ErrorsManager.cs b/CSharp/ErrorsManager.cs index c783236..e7aa567 100644 --- a/CSharp/ErrorsManager.cs +++ b/CSharp/ErrorsManager.cs @@ -1,40 +1,45 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; -using System.Net.Mail; using System.Text.RegularExpressions; namespace ErrorsManager{ - // public abstract record Error{ - - // private Error(){} - - // public sealed record String(string value):Error; - // public sealed record Array(byte[] value):Error; - // public sealed record Integer(int value):Error; - - // } - - class ErrorsManager{ + public class ErrorsManager{ public static readonly char[] ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".ToCharArray(); + public static readonly string[] ERRORS_MESSAGES = new string[]{ + "invalid_alphabet", + "invalid_base", + "invalid_alphabet_type", + "too_short_alphabet", + "repeated_characters_in_alphabet", + "too_long_alphabet", + "base_lower_than_2", + "base_greater_than_128", + "base_greater_than_alphabet" + }; + public static readonly Regex RE_KEY = new Regex(@"^[a-z_][a-z0-9_]*$", RegexOptions.IgnoreCase | RegexOptions.Compiled); - private Error error = 0; - private char[] alphabet; + private int error = 0; + private char[] alphabet = new char[0]; private Dictionary dictionary = new Dictionary(); private byte _base; private byte power; - public ErrorsManager(object? inputs = null){ + public ErrorsManager(object inputs = null){ - set_alphabet(get("alphabet", inputs, ALPHABET)); + set_alphabet( + get("alphabet", inputs, ALPHABET), + get("base", inputs, 64) + ); } - public int set_alphabet(object? alphabet = null){ + public int set_alphabet(object alphabet = null, int _base = 64){ int original_length; @@ -63,10 +68,19 @@ namespace ErrorsManager{ error |= 1 << 4; if(this.alphabet.Length > 128) error |= 1 << 5; + + error |= ( + _base < 2 ? 1 << 0 : + _base > 128 ? 1 << 1 : + _base >= this.alphabet.Length ? 1 << 2 : + 0) << 6; + + if(error >> 6 == 0) + this.alphabet = this.alphabet.Take(_base).ToArray(); this.alphabet = this.alphabet.Take( - _base = (byte)Math.Pow(2, - power = (byte)Math.Log2(this.alphabet.Length) + this._base = (byte)Math.Pow(2, + power = (byte)Math.Log2(this.alphabet.Take(128).Count()) ) ).ToArray(); @@ -81,73 +95,96 @@ namespace ErrorsManager{ return new string(alphabet); } - public byte[] to_array(object code){ - if(code is string _string) - return _string.Select(character => dictionary[character]).ToArray(); - if(code is byte[] array) - return array; - if(code is int integer){ - - List hexas = new List(); - - while(integer != 0){ - hexas.Add((byte)(integer % _base)); - integer /= _base; - } - - return hexas.ToArray(); - } - return new byte[]{}; + public byte[] to_array(string code){ + return code.Select(character => dictionary[character]).ToArray(); } - public string to_string(object code){ - if(code is string _string) - return _string; - if(code is byte[] array) - return new string(array.Select(value => alphabet[value]).ToArray()); - if(code is int integer){ - - string hexas = new string(); - - while(integer != 0){ - hexas += alphabet[(byte)(integer % _base)]; - integer /= _base; - } - - return hexas; - } - return ""; + public byte[] to_array(byte[] code){ + return code; } - public int to_integer(object code){ - if(code is string _string){ - - int integer = 0; + public byte[] to_array(int code){ - for(byte i = 0; i < _string.Length; i ++) - integer = integer * _base + dictionary[_string[i]]; + List hexas = new List(); - return integer; + while(code != 0){ + hexas.Add((byte)(code % _base)); + code /= _base; } - if(code is byte[] array){ - - int integer = 0; - for(byte i = 0; i < array.Length; i ++) - integer = integer * _base + array[i]; - - return integer; - } - if(code is int integer) - return integer; - return 0; + return hexas.ToArray(); } - public (int, string)[] process(Error code, IEnumerable messages){ + public string to_string(byte[] code){ + return new string(code.Select(value => alphabet[value]).ToArray()); + } + + public string to_string(int code){ + string hexas = ""; + + while(code != 0){ + hexas += alphabet[(byte)(code % _base)]; + code /= _base; + } + + return hexas; + } + + public string to_string(string code){ + return code; + } + + public int to_integer(string code){ + + int _string = 0; + + for(int i = code.Length - 1; i >= 0; i --) + _string = _string * _base + dictionary[code[i]]; + + return _string; + } + + public int to_integer(byte[] code){ + + int array = 0; + + for(int i = code.Length - 1; i >= 0; i --) + array = array * _base + code[i]; + + return array; + } + + public int to_integer(int code){ + return code; + } + + public string to_string_binary(string code){ + return string.Join("", code.Reverse().Select(character => Convert.ToString(dictionary[character], 2).PadLeft(power, '0'))); + } + + public string to_string_binary(byte[] code){ + return string.Join("", code.Reverse().Select(hexa => Convert.ToString(hexa, 2).PadLeft(power, '0'))); + } + + public string to_string_binary(int code){ + + string binary = Convert.ToString(code, 2); + int remainer = binary.Length % power; + + return ( + remainer == 0 ? binary : + binary.PadLeft(binary.Length + power - remainer, '0')); + } + + public (int, string)[] process(string code, IEnumerable messages){ + return process(to_array(code), messages); + } + + public (int, string)[] process(byte[] code, IEnumerable messages){ List<(int, string)> response = new List<(int, string)>(); - for_each_enumerate(get_hexas_from(code), (hexa, i) => { + for_each_enumerate(code, (hexa, i) => { for(byte j = 0; j < power && (hexa & 1 << j) <= hexa; j ++) if((hexa & 1 << j) != 0){ @@ -161,81 +198,112 @@ namespace ErrorsManager{ return response.ToArray(); } - public int get_bits(object code){ - if(code is string _string) - return _string.Length == 0 ? 0 : (_string.Length - 1) * power + (int)Math.Ceiling(Math.Log2(dictionary[_string.Last()] + 1)); - if(code is byte[] array) - return array.Length == 0 ? 0 : (array.Length - 1) * power + (int)Math.Ceiling(Math.Log2(array.Last() + 1)); - if(code is int integer) - return (int)Math.Ceiling(Math.Log2(integer + 1)); - return 0; + public (int, string)[] process(int code, IEnumerable messages){ + return process(to_array(code), messages); } - public T bitwise(T code, int bits){ - if(code is string _string) - return (T)(object)to_string(bitwise(to_array(_string), bits)); - if(code is byte[] array){ + public int get_bits(string code){ + return code.Length == 0 ? 0 : (code.Length - 1) * power + (int)Math.Ceiling(Math.Log2(dictionary[code.Last()] + 1)); + } - byte shift; - int mask; - List hexas; + public int get_bits(byte[] code){ + return code.Length == 0 ? 0 : (code.Length - 1) * power + (int)Math.Ceiling(Math.Log2(code.Last() + 1)); + } - if(bits < 0){ - if(array.Length < (int)((bits *= -1) / power)) - return (T)(object)new byte[]{0}; - - shift = (byte)(bits % power); - mask = _base - 1; - hexas = array.ToList(); + public int get_bits(int code){ + return (int)Math.Ceiling(Math.Log2(code + 1)); + } - hexas.RemoveRange(0, (int)(bits / power)); + public string clean(string code){ - if(shift != 0 && hexas.Count != 0){ + int l = code.Length; - int l = hexas.Count - 1; + while(l > 0 && code[l - 1] == alphabet[0]) + l --; - for(int i = 0; i < l; i ++) - hexas[i] = (byte)((hexas[i] >> shift) | ((hexas[i + 1] << (power - shift)) & mask)); - hexas[hexas.Count - 1] >>= shift; + return ( + code.Length == l ? code : + l == 0 ? alphabet[0].ToString() : + code.Substring(0, l)); + } - } + public byte[] clean(byte[] code){ - return (T)(object)hexas.ToArray(); - }; - if(bits > 0){ + int l = code.Length; - shift = (byte)(bits % power); - mask = _base - 1; - hexas = array.ToList(); + while(l > 0 && code[l - 1] == 0) + l --; - if(shift != 0){ + return ( + l == code.Length ? code : + l == 0 ? new byte[]{0} : + code.Take(l).ToArray()); + } - int last_hexa = hexas[hexas.Count - 1] << shift; - - for(int i = hexas.Count - 1; i > 0; i --) - hexas[i] = (byte)((hexas[i] << shift) | ((hexas[i - 1] >> (power - shift)) & mask)); - hexas[0] = (byte)((hexas[0] << shift) & mask); - - if(last_hexa >= _base) - hexas.Add((byte)(last_hexa >> power)); - - } - for(int i = bits / power; i > 0; i --) - hexas.Insert(0, 0); - - return (T)(object)hexas.ToArray(); - } - return (T)(object)array; - } - if(code is int integer) - return (T)(object)( - bits > 0 ? integer << bits : - bits < 0 ? integer >> -bits : - integer); + public int clean(int code){ return code; } - public void get_from_bits(object code, ref int from, ref int bits){ + public string bitwise(string code, int bits){ + return to_string(bitwise(to_array(code), bits)); + } + public byte[] bitwise(byte[] code, int bits){ + if(code.Length == 0 || bits == 0) + return code; + + byte shift = (byte)(Math.Abs(bits) % power); + int mask = _base - 1; + List hexas = code.ToList(); + + if(bits < 0){ + + hexas.RemoveRange(0, (int)(-bits / power)); + + if(shift != 0 && hexas.Count != 0){ + + int l = hexas.Count - 1; + + for(int i = 0; i < l; i ++) + hexas[i] = (byte)((hexas[i] >> shift) | ((hexas[i + 1] << (power - shift)) & mask)); + hexas[hexas.Count - 1] >>= shift; + + } + + }else{ + + if(shift != 0){ + + int last_hexa = hexas[hexas.Count - 1] << shift; + + for(int i = hexas.Count - 1; i > 0; i --) + hexas[i] = (byte)(((hexas[i] << shift) & mask) | (hexas[i - 1] >> (power - shift))); + hexas[0] = (byte)((hexas[0] << shift) & mask); + + if(last_hexa >= _base) + hexas.Add((byte)(last_hexa >> power)); + + } + + for(int i = bits / power; i > 0; i --) + hexas.Insert(0, 0); + + } + + return clean(hexas.ToArray()); + } + + public int bitwise(int code, int bits){ + return ( + bits > 0 ? code << bits : + bits < 0 ? code >> -bits : + code); + } + + public void get_from_bits(string code, ref int from, ref int bits){ + get_from_bits(to_array(code), ref from, ref bits); + } + + public void get_from_bits(byte[] code, ref int from, ref int bits){ if(from < 0){ from = get_bits(code) + from; if(from < 0) @@ -251,118 +319,214 @@ namespace ErrorsManager{ } } - public T reset(T code, int from, int bits = 0, bool reversed = false){ - if(bits == 0 || (from == 0 && bits < 0)) - return code; - if(code is string _string) - return (T)(object)to_string(reset(to_array(_string), from, bits, reversed)); - if(code is byte[] array){ + public void get_from_bits(int code, ref int from, ref int bits){ + get_from_bits(to_array(code), ref from, ref bits); + } - List hexas = array.ToList(); - int hexa_from; - int hexa_to; - int l; - byte from_mask; - byte to_mask; + public string reset(string code, int from, int bits = 0, bool reversed = false){ + return to_string(reset(to_array(code), from, bits, reversed)); + } - get_from_bits(array, ref from, ref bits); - hexa_from = (int)(from / power); - hexa_to = (int)((from + bits) / power); + public byte[] reset(byte[] code, int from, int bits = 0, bool reversed = false){ - if(reversed){ + List hexas = code.ToList(); + int hexa_from; + int hexa_to; + int l; + byte from_mask; + byte to_mask; - l = from % power; - from_mask = (byte)(~-(1 << power - l) << l); - to_mask = (byte)~-(1 << (from + bits) % power); + get_from_bits(code, ref from, ref bits); + hexa_from = (int)(from / power); + hexa_to = (int)((from + bits) / power); - for(int i = 0; i < hexas.Count; i ++) - if(i < hexa_from || i > hexa_to) - hexas[i] = 0; + if(reversed){ - if(hexa_from == hexa_to) - hexas[hexa_to] &= (byte)(from_mask & to_mask); - else{ - hexas[hexa_from] &= from_mask; - if(hexa_to < hexas.Count) - hexas[hexa_to] &= to_mask; - } + l = from % power; + from_mask = (byte)(~-(1 << power - l) << l); + to_mask = (byte)~-(1 << (from + bits) % power); + for(int i = 0; i < hexas.Count; i ++) + if(i < hexa_from || i > hexa_to) + hexas[i] = 0; + + if(hexa_from == hexa_to) + hexas[hexa_to] &= (byte)(from_mask & to_mask); + else{ + hexas[hexa_from] &= from_mask; + if(hexa_to < hexas.Count) + hexas[hexa_to] &= to_mask; + } + + }else{ + + l = (from + bits) % power; + from_mask = (byte)~-(1 << (from % power)); + to_mask = (byte)(~-(1 << power - l) << l); + + if(hexa_from == hexa_to){ + hexas[hexa_to] &= (byte)(from_mask | to_mask); }else{ - - l = (from + bits) % power; - from_mask = (byte)~-(1 << (from % power)); - to_mask = (byte)(~-(1 << power - l) << l); - - if(hexa_from == hexa_to){ - hexas[hexa_to] &= (byte)(from_mask | to_mask); - }else{ - hexas[hexa_from] &= from_mask; - for(int i = hexa_from + 1; i < hexa_to && i < hexas.Count; i ++) - hexas[i] = 0; - if(hexa_to < hexas.Count) - hexas[hexa_to] &= to_mask; - } + hexas[hexa_from] &= from_mask; + for(int i = hexa_from + 1; i < hexa_to && i < hexas.Count; i ++) + hexas[i] = 0; + if(hexa_to < hexas.Count) + hexas[hexa_to] &= to_mask; } - - return (T)(object)hexas.ToArray(); } - if(code is int integer){ - get_from_bits(integer, ref from, ref bits); - - return (T)(object)(integer & (reversed ? - ~-(1 << bits) << from : - (~-(1 << get_bits(integer)) << from + bits) | ~-(1 << from))); - } - return code; + return hexas.ToArray(); } - public T get_range(T code, int from, int length = 0){ - if(code is string _string) - return to_string(get_range(to_array(_string), length)); - if(code is byte[] array){ + public int reset(int code, int from, int bits = 0, bool reversed = false){ - List hexas = new List(); + get_from_bits(code, ref from, ref bits); + if(from + bits > 31) + bits = 31 - from; - if(from > 0){ + return code & (reversed ? + ~-(1 << bits) << from : + (~-(1 << get_bits(code)) << from + bits) | ~-(1 << from)); - byte shift = (byte)(from % power); - int mask = ~-_base; + } - hexas.AddRange(array.Take(from / power)); - if(shift != 0){ - for(int i = hexas.Count - 2; i >= 0; i --) - hexas[i] = (byte)((hexas[i] >> shift) | ((hexas[i + 1] << (power - shift)) & mask)); - hexas[hexas.Count - 1] = (byte)(hexas.Last() >> shift); - } + public string get_range(string code, int from, int bits = 0){ + return to_string(get_range(to_array(code), from, bits)); + } - } - if(length > 0){ + public byte[] get_range(byte[] code, int from, int bits = 0){ - byte shift = (byte)(length % power); + List hexas; - hexas.Take((int)Math.Ceiling(hexas.Count / (double)power)); - if(shift != 0) - hexas[hexas.Count - 1] = (byte)(hexas.Last() & ~-(1 << shift)); + get_from_bits(code, ref from, ref bits); + + if(bits == 0) + bits = get_bits(code) - from; + if(bits <= 0) + return new byte[]{0}; + + hexas = code.ToList(); + + if(from > 0){ + + byte shift = (byte)(from % power); + int mask = ~-_base; + + hexas = hexas.Skip(from / power).ToList(); + if(shift != 0 && hexas.Count > 0){ + + int l = hexas.Count - 1; + for(int i = 0; i < l; i ++) + hexas[i] = (byte)((hexas[i] >> shift) | ((hexas[i + 1] << (power - shift)) & mask)); + hexas[hexas.Count - 1] >>= shift; } - return to_integer(array.Skip(from / power).Take((int)Math.Ceiling((length != 0 ? length : get_bits(array) - from) / (double)power)).ToArray()); } - if(code is int integer) - return (from > 0 ? integer >> from : integer) & (length > 0 ? ~(-1 << length) : integer); - return code; + if(bits > 0){ + + byte shift = (byte)(bits % power); + + hexas = hexas.Take((int)Math.Ceiling(bits / (double)power)).ToList(); + if(shift != 0 && hexas.Count > 0) + hexas[hexas.Count - 1] &= (byte)((1 << shift) - 1); + + } + + return clean(hexas.ToArray()); } - public bool has(Error code, int? bits = null){ - return code switch{ - Error.String _string => _string.value.ToList().Take(get_hexas_from_bits(bits)).Length * power > bits, - Error.Array array => array.value.ToList().Take(Math.Ceiling(Math.Log2(bits))).Where(hexa => hexa != 0).Count() != 0, - Error.Integer integer => (bits != null && bits != 0 ? ~-(1 << bits) & integer.value : integer.value) != 0, - _ => false - }; + public int get_range(int code, int from, int bits = 0){ + + get_from_bits(code, ref from, ref bits); + + if(from > 0) + code = (code >> from) & ((1 << (31 - from)) - 1); + + if(bits <= 0 || bits >= 31) + return code; + + if(from + bits > 31) + bits = 31 - from; + + return code & ((1 << bits) - 1); } - public static List get_keys(object? items){ + public bool has(string code, int from = 0, int bits = 0){ + foreach(char character in get_range(code, from, bits)) + if(character != alphabet[0]) + return true; + return false; + } + + public bool has(byte[] code, int from = 0, int bits = 0){ + foreach(byte hexa in get_range(code, from, bits)) + if(hexa != 0) + return true; + return false; + } + + public bool has(int code, int from = 0, int bits = 0){ + return get_range(code, from, bits) != 0; + } + + public string set(string error, string code, int _from = 0, int bits = 0){ + return to_string(set(to_array(error), to_array(code), _from, bits)); + } + + public string set(string error, byte[] code, int _from = 0, int bits = 0){ + return to_string(set(to_array(error), code, _from, bits)); + } + + public string set(string error, int code, int _from = 0, int bits = 0){ + return to_string(set(to_array(error), to_array(code), _from, bits)); + } + + public byte[] set(byte[] error, string code, int _from = 0, int bits = 0){ + return set(error, to_array(code), _from, bits); + } + + public byte[] set(byte[] error, byte[] code, int _from = 0, int bits = 0){ + + int l; + int m = error.Length; + int n = code.Length; + List results = new List(); + + if(bits != 0) + error = reset(error, _from, bits); + if(_from != 0) + n = (code = bitwise(code, _from)).Length; + l = m > n ? m : n; + + for(int i = 0; i < l; i ++) + results.Add((byte)( + (i < m ? error[i] : (byte)0) | (i < n ? code[i] : (byte)0) + )); + + return clean(results.ToArray()); + } + + public byte[] set(byte[] error, int code, int _from = 0, int bits = 0){ + return set(error, to_array(code), _from, bits); + } + + public int set(int error, string code, int _from = 0, int bits = 0){ + return to_integer(set(error, to_integer(code), _from, bits)); + } + + public int set(int error, byte[] code, int _from = 0, int bits = 0){ + return to_integer(set(error, to_integer(code), _from, bits)); + } + + public int set(int error, int code, int _from = 0, int bits = 0){ + if(bits != 0) + error = reset(error, _from, bits); + if(_from != 0) + code = bitwise(code, _from); + return error | code; + } + + public static List get_keys(object items){ List keys = new List(); @@ -373,8 +537,8 @@ namespace ErrorsManager{ foreach(string item_i in strings) if(!keys.Contains(item_i) && RE_KEY.IsMatch(item_i)) keys.Add(item_i); - }else if(items is IEnumerable list) - foreach(object? item in list){ + }else if(items is IEnumerable list) + foreach(object item in list){ if(item == null) continue; if(item is string string_item){ @@ -389,27 +553,27 @@ namespace ErrorsManager{ return keys; } - public static List> get_dictionaries(object? items){ + public static List> get_dictionaries(object items){ - List> dictionaries = new List>(); + List> dictionaries = new List>(); - if(items is Dictionary dictionary) + if(items is Dictionary dictionary) dictionaries.Add(dictionary); - else if(items is IEnumerable list) - foreach(object? item in list) + else if(items is IEnumerable list) + foreach(object item in list) dictionaries.AddRange(get_dictionaries(item)); return dictionaries; } - public static T? get(object keys, object? dictionaries, T? _default = default(T?)){ + public static T get(object keys, object dictionaries, T _default = default(T)){ List keys_list = get_keys(keys); if(keys_list.Count != 0) - foreach(Dictionary dictionary in get_dictionaries(dictionaries)) + foreach(Dictionary dictionary in get_dictionaries(dictionaries)) foreach(string key in keys_list) - if(dictionary.TryGetValue(key, out object? value) && value is T typed) + if(dictionary.TryGetValue(key, out object value) && value is T typed) return typed; return _default; } diff --git a/CSharp/ErrorsManager.csproj b/CSharp/ErrorsManager.csproj index 41964d3..b77cc88 100755 --- a/CSharp/ErrorsManager.csproj +++ b/CSharp/ErrorsManager.csproj @@ -1,23 +1,17 @@ Exe + net10.0;net462 - enable + enable - latest - AnP - AnP + ErrorsManager + ErrorsManager + false - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - + + + \ No newline at end of file diff --git a/CSharp/ErrorsManager.slnx b/CSharp/ErrorsManager.slnx new file mode 100644 index 0000000..ecad6ca --- /dev/null +++ b/CSharp/ErrorsManager.slnx @@ -0,0 +1,3 @@ + + + diff --git a/CSharp/Program.cs b/CSharp/Program.cs index 777ff2d..d258702 100755 --- a/CSharp/Program.cs +++ b/CSharp/Program.cs @@ -2,12 +2,17 @@ using System; namespace ErrorsManager{ class Program{ + public static void Main(string[] args){ - static void Main(string[] args){ - - Console.WriteLine("Hello World!"); + // Tests.errors(); + // Tests.conversions(); + // Tests.alphabet(); + // Tests.bitwise(); + // Tests.bitwise_sucesive(); + // Tests.bits(); + // Tests.reset(); + Tests.ranges(); } - } } \ No newline at end of file diff --git a/CSharp/Tests.cs b/CSharp/Tests.cs new file mode 100644 index 0000000..8ce62db --- /dev/null +++ b/CSharp/Tests.cs @@ -0,0 +1,241 @@ +using System; + +namespace ErrorsManager{ + + class FullError{ + + public int integer; + public string _string; + public byte[] array; + + public FullError(ErrorsManager errors, int integer){ + this.integer = integer; + _string = errors.to_string(integer); + array = errors.to_array(integer); + } + + public FullError(ErrorsManager errors, string _string){ + integer = errors.to_integer(_string); + this._string = _string; + array = errors.to_array(_string); + } + + public FullError(ErrorsManager errors, byte[] array){ + integer = errors.to_integer(array); + _string = errors.to_string(array); + this.array = array; + } + + public static string print(byte[] array){ + return "[" + string.Join(", ", array) + "]"; + } + + } + + class Tests{ + + public static void errors(){ + + ErrorsManager errors = new ErrorsManager(); + FullError error = new FullError(errors, 217934237); + FullError reset = new FullError(errors, 0); + + reset.integer = errors.reset(error.integer, -5, 12); + reset._string = errors.reset(error._string, -5, 12); + reset.array = errors.reset(error.array, -5, 12); + + Console.WriteLine($"RESET: from {-5} bits {12}"); + Console.WriteLine($"INTEGER: {errors.to_string_binary(error.integer)} - {errors.to_string_binary(reset.integer)}"); + Console.WriteLine($"STRING: {errors.to_string_binary(error._string)} - {errors.to_string_binary(reset._string)}"); + Console.WriteLine($"ARRAY: {errors.to_string_binary(error.array)} - {errors.to_string_binary(reset.array)}"); + Console.WriteLine(); + + } + + public static ErrorsManager conversions(int tests = 10, object inputs = null){ + + ErrorsManager errors = new ErrorsManager(inputs); + Random seed = new Random(); + + for(int i = 0; i < tests; i ++){ + + FullError error = new FullError(errors, seed.Next(0, 1 << 16)); + + Console.WriteLine($"INTEGER: {errors.to_integer(error.integer)}, {errors.to_integer(error._string)}, {errors.to_integer(error.array)}"); + Console.WriteLine($"STRING: {errors.to_string(error.integer)}, {errors.to_string(error._string)}, {errors.to_string(error.array)}"); + Console.WriteLine($"ARRAY: {FullError.print(errors.to_array(error.integer))}, {FullError.print(errors.to_array(error._string))}, {FullError.print(errors.to_array(error.array))}"); + Console.WriteLine(); + + } + + return errors; + } + + public static void alphabet(int tests = 10){ + + Random seed = new Random(); + + for(int i = 0; i < tests; i ++){ + + ErrorsManager errors = conversions(1, new Dictionary() { + {"base", seed.Next(2, 128)} + }); + + Console.WriteLine($"^^^ ALPHABET: {string.Join(", ", errors.get_alphabet())} ^^^"); + Console.WriteLine(); + + } + } + + public static void bitwise(int tests = 10){ + + ErrorsManager errors = new ErrorsManager(); + Random seed = new Random(); + + for(int i = 0; i < tests; i ++){ + + FullError error = new FullError(errors, seed.Next(0, 1 << seed.Next(0, 16))); + FullError shifted = new FullError(errors, 0); + FullError unshifted = new FullError(errors, 0); + int bitwise = 10 - seed.Next(0, 20); + + Console.WriteLine($"BITWISE: {bitwise}"); + + shifted.integer = errors.bitwise(error.integer, bitwise); + shifted._string = errors.bitwise(error._string, bitwise); + shifted.array = errors.bitwise(error.array, bitwise); + unshifted.integer = errors.bitwise(shifted.integer, -bitwise); + unshifted._string = errors.bitwise(shifted._string, -bitwise); + unshifted.array = errors.bitwise(shifted.array, -bitwise); + + Console.WriteLine($"INTEGER: {errors.to_string_binary(error.integer)} - {error.integer}"); + Console.WriteLine($"STRING: {errors.to_string_binary(error._string)} - {error._string}"); + Console.WriteLine($"ARRAY: {errors.to_string_binary(error.array)} - {FullError.print(error.array)}"); + Console.WriteLine($"INTEGER: {errors.to_string_binary(shifted.integer)} - {shifted.integer}"); + Console.WriteLine($"STRING: {errors.to_string_binary(shifted._string)} - {shifted._string}"); + Console.WriteLine($"ARRAY: {errors.to_string_binary(shifted.array)} - {FullError.print(shifted.array)}"); + Console.WriteLine($"INTEGER: {errors.to_string_binary(unshifted.integer)} - {unshifted.integer}"); + Console.WriteLine($"STRING: {errors.to_string_binary(unshifted._string)} - {unshifted._string}"); + Console.WriteLine($"ARRAY: {errors.to_string_binary(unshifted.array)} - {FullError.print(unshifted.array)}"); + Console.WriteLine(); + + } + + } + + public static void bitwise_sucesive(int tests = 10){ + + ErrorsManager errors = new ErrorsManager(); + FullError error = new FullError(errors, new Random().Next(0, 1 << 16)); + + Console.WriteLine($"INTEGER: {errors.to_string_binary(error.integer)} - {error.integer}"); + Console.WriteLine($"STRING: {errors.to_string_binary(error._string)} - {error._string}"); + Console.WriteLine($"ARRAY: {errors.to_string_binary(error.array)} - {FullError.print(error.array)}"); + Console.WriteLine(); + + for(int i = -tests; i < tests; i ++){ + + FullError shifted = new FullError(errors, 0); + + Console.WriteLine($"BITWISE: {i}"); + + shifted.integer = errors.bitwise(error.integer, i); + shifted._string = errors.bitwise(error._string, i); + shifted.array = errors.bitwise(error.array, i); + + + Console.WriteLine($"INTEGER: {errors.to_string_binary(shifted.integer)} - {shifted.integer}"); + Console.WriteLine($"STRING: {errors.to_string_binary(shifted._string)} - {shifted._string}"); + Console.WriteLine($"ARRAY: {errors.to_string_binary(shifted.array)} - {FullError.print(shifted.array)}"); + Console.WriteLine(); + + } + + } + + public static void bits(int tests = 10){ + + ErrorsManager errors = new ErrorsManager(); + Random seed = new Random(); + + for(int i = 0; i < tests; i++){ + + FullError error = new FullError(errors, seed.Next(0, 1 << seed.Next(0, 28))); + int from_value = seed.Next(-15, 15); + int bits_value = seed.Next(-13, 13); + int[] from = new int[]{from_value, from_value, from_value}; + int[] bits = new int[]{bits_value, bits_value, bits_value}; + + errors.get_from_bits(error.integer, ref from[0], ref bits[0]); + errors.get_from_bits(error._string, ref from[1], ref bits[1]); + errors.get_from_bits(error.array, ref from[2], ref bits[2]); + + + Console.WriteLine($"CODE: {error.integer} - {error._string} - {FullError.print(error.array)}"); + Console.WriteLine($"ERROR: {errors.to_string_binary(error.integer)} - {errors.get_bits(error.integer)} - {errors.get_bits(error._string)} - {errors.get_bits(error.array)}"); + Console.WriteLine($"FROM: {from_value} - {from[0]}, {from[1]}, {from[2]}"); + Console.WriteLine($"BITS: {bits_value} - {bits[0]}, {bits[1]}, {bits[2]}"); + Console.WriteLine(); + + } + + } + + public static void reset(int tests = 10){ + + ErrorsManager errors = new ErrorsManager(); + Random seed = new Random(); + + for(int i = 0; i < tests; i ++){ + + FullError error = new FullError(errors, seed.Next(0, 1 << 28)); + int from = seed.Next(-15, 15); + int bits = seed.Next(-13, 13); + FullError reset = new FullError(errors, 0); + + reset.integer = errors.reset(error.integer, from, bits); + reset._string = errors.reset(error._string, from, bits); + reset.array = errors.reset(error.array, from, bits); + + Console.WriteLine($"RESET: from {from} bits {bits}"); + Console.WriteLine($"INTEGER: {errors.to_string_binary(error.integer)} - {errors.to_string_binary(reset.integer)}"); + Console.WriteLine($"STRING: {errors.to_string_binary(error._string)} - {errors.to_string_binary(reset._string)}"); + Console.WriteLine($"ARRAY: {errors.to_string_binary(error.array)} - {errors.to_string_binary(reset.array)}"); + Console.WriteLine(); + + } + + } + + public static void ranges(int tests = 10){ + + ErrorsManager errors = new ErrorsManager(); + Random seed = new Random(); + + for(int i = 0; i < tests; i ++){ + + FullError error = new FullError(errors, seed.Next(0, 1 << 28)); + int from = seed.Next(-15, 15); + int bits = seed.Next(-13, 13); + FullError range = new FullError(errors, 0); + + Console.WriteLine($"RANGE: from {from} bits {bits}"); + errors.get_from_bits(error._string, ref from, ref bits); + Console.WriteLine($"REAL: from {from} bits {bits}"); + + range.integer = errors.get_range(error.integer, from, bits); + range._string = errors.get_range(error._string, from, bits); + range.array = errors.get_range(error.array, from, bits); + + Console.WriteLine($"INTEGER: {errors.to_string_binary(error.integer)} - {errors.to_string_binary(range.integer)}"); + Console.WriteLine($"STRING: {errors.to_string_binary(error._string)} - {errors.to_string_binary(range._string)}"); + Console.WriteLine($"ARRAY: {errors.to_string_binary(error.array)} - {errors.to_string_binary(range.array)}"); + Console.WriteLine(); + + } + + } + + } + +} \ No newline at end of file diff --git a/README.md b/README.md index c23fee9..0062c9e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,190 @@ # ErrorsManager -Errors codes manager for binary errors system, unlocking the 32 bits limit. \ No newline at end of file +**ErrorsManager** es una librería que nos permite hacer una gestión de errores mediante códigos de error en base binaria o agrupación de base numérica. La idea es poder trasladar un análisis global de errores entre plataformas de forma simple con el condicionante que ambas plataformas han de conocer estructuralmente el sistema de errores. El propósito de dicho sistema es conseguir un sistema unificado de errores que permita el envío compacto de los mismos evitando un uso innecesario de red. + +# Funcionamiento + +La idea es crear un objeto `ErrorsManager` para gestionar los errores dentro del código y hacer uso de `set`, `has` y `process` para gestionar los errores, aunque de por sí tenga más funcionalidades. + +> **NOTA**: Este manual ordenará los métodos y estructuras conforme su utilidad e importancia fuera del ámbito de la propia librería para uso general. + +## Constructor + +`errors_manager:ErrorsManager = new ErrorsManager(inputs:dict[str, any|null])` + +- **alphabet**: Alfabeto String o Array de Caracteres. +- **base**: Entero que representa la máxima base 2 numérica que se usará: 16, 32 o 64, por ejemplo. + +El alfabeto no puede contener caracteres iguales, y si los contiene, se encargará de eliminarlos, reduciendo la posibilidad de base. + +## set + +`error:int = errors_manager.set(from:int, code:int|list[byte]|str, from:int = 0, bits:int = 0)` + +`error:list[byte]= errors_manager.set(from:list[byte], code:int|list[byte]|str, from:int = 0, bits:int = 0)` + +`error:str = errors_manager.set(from:str, code:int|list[byte]|str, from:int = 0, bits:int = 0)` + +1. **error**: Código de error original. Puede ser un String, Array de enteros que representan los Hexas o un entero. +2. **code**: Código de error a establecer. Puede ser un String, Array de enteros que representan los Hexas o un entero. +3. **from**: Determina si se quiere desplazar `code`. 0 indica que no. +4. **bits**: Determina si se pasan a 0 los bits que de `error` desde `from`. 0 indica que no. + +El `from` negativo indica que se cuente desde el final, y el `bits` negativo que se cuente para atrás. Esto se establece desde `ErrorsManager.get_from_bits`. + +Retorna el resultado de la unión de `error` con `code` a partir de las posibles modificaciones de `from` y `bits`. + +## has + +`has:bool = errors_manager.has(code:int|list[byte]|str)` + +Determina si un código de error contiene errores o no. + +## process + +`errors_messages:list[tuple[int, str]] = errors_manager.process(code:int|list[byte]|str, messages:list[str] = [ ... ])` + +Permite recoger el conjunto de mensajes conforme al código de error. Cada mensaje irá acompañado de su Bit de posición, de ahí que retorne una lista de tuplas de un valor entero, que es el Bit de posición; y el String, que es el mensaje en cuestión. + +`[position, message for position:int, message:str in errors_messages]` + +Si retorna una lista vacía es que no hay errores. + +# .NET + +- Docker Hub del SDK: https://hub.docker.com/r/microsoft/dotnet-sdk +- Git del SDK: https://github.com/dotnet/sdk + +Para crear los SLN de la Solución: + +```sh +#!/bin/bash + +docker exec -it anp-dotnet bash + +cd CSharp +dotnet new sln -n ErrorsManager +dotnet sln add ErrorsManager.csproj +cd .. + +exit + +sudo chown -R root:$USER CSharp/ErrorsManager.slnx + +``` + +Luego hay que pelar el archivo de definición de proyecto `ErrorsManager.csproj`: + +```xml + + + Exe + + net10.0;net462 + enable + enable + ErrorsManager + ErrorsManager + false + + + + + + + +``` + +Instalación del SDK para desarrollo VSCode. + +```sh +#!/bin/bash +wget https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb +sudo dpkg -i packages-microsoft-prod.deb +rm packages-microsoft-prod.deb +sudo apt update +sudo apt install -y dotnet-sdk-10.0 +``` + +Luego, instalar el Pluggin Nuget de Visual Studio Code `C/C++ DevTools`. + +Para ejecutar un proyecto .NET desde Docker. + +```sh +#!/bin/bash +docker exec -it anp-dotnet dotnet run --project /workspace/CSharp/ErrorsManager.csproj -f net10.0 +``` + +Para compilar DLL primero configurar el archivo de definición de proyecto `ErrorsManager.csproj`. + +```xml + + + + Library + net10.0;net462 + enable + enable + ErrorsManager + ErrorsManager + false + + + + + + +``` + +Y luego ejecutar: + +```sh +#!/bin/bash +dotnet build ErrorsManager.csproj -c Release +``` + +# Objetivos + +Leyenda: + +- **Py**: Python +- **PHP** +- **JS**: JavaScript/ECMAScript +- **MSL**: SQLServer/TransactSQL +- **MyL**: MySQL/MariaDB +- **CS**: C#/CSharp +- **VB**: VisualBasic +- **Go**: Golang +- **RS**: Rust +- **C** +- **CPP**: C++ + +Tabla de objetivos: + +| Objetivo | Py | PHP | JS | MSL | MyS | CS | VB | Go | RS | C | CPP | +|-------------------|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----| +| Common base | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| set_alphabet | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| get_alphabet | [ ] | [ ] | [ ] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| to_array | [X] | [ ] | [X] | | | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| to_integer | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| to_string | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| to_string_binary | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| process | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| get_bits | [ ] | [ ] | [ ] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| bitwise | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| get_from_bits | [ ] | [ ] | [ ] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| reset | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| get_range | [ ] | [ ] | [ ] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| has | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| clean | [ ] | [ ] | [ ] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | +| set | [X] | [ ] | [X] | [ ] | [ ] | [X] | [ ] | [ ] | [ ] | [ ] | [ ] | + +> **NOTA**: Los Checkbox indican el estado siendo los siguientes: + +- [ ] Sin cubrir, está por hacerse. +- [-] Están en desarrollo actualmente. +- [X] Ya está hecho y es usable. + +> **NOTA**: Según lenguajes que tenga cierta rigidez, como es el caso de Golang, los nombres de los métodos y atributos pueden cambiar a Camel o Pascal. \ No newline at end of file diff --git a/version b/version index 340ff46..f477849 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.0.2.1 \ No newline at end of file +0.2.2 \ No newline at end of file