FreeBSD Bugzilla – Attachment 234598 Details for
Bug 264592
BSD Grep & BASH-Completion
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
bash -x: Working Logs
Trace Logs (bash -x).Txt (text/plain), 22.25 KB, created by
CrazyMihey
on 2022-06-10 11:34:28 UTC
(
hide
)
Description:
bash -x: Working Logs
Filename:
MIME Type:
Creator:
CrazyMihey
Created:
2022-06-10 11:34:28 UTC
Size:
22.25 KB
patch
obsolete
># uname -v | tr "\r\n" " " && uname -p >FreeBSD 12.1-RELEASE-p2 r358570 CrazyBook i386 ># env LANG="C" bash --version >GNU bash, version 5.1.16(0)-release (i386-portbld-freebsd12.1) >Copyright (C) 2020 Free Software Foundation, Inc. >License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> > >This is free software; you are free to change and redistribute it. >There is NO WARRANTY, to the extent permitted by law. > ># pkg info bash-completion >bash-completion-2.11_1,2 >Name : bash-completion >Version : 2.11_1,2 >Installed on : Sun May 29 16:49:05 2022 MSK >Origin : shells/bash-completion >Architecture : FreeBSD:13:* >Prefix : /usr/local >Categories : shells >Licenses : BSD2CLAUSE, GPLv2+ >Maintainer : sunpoet@FreeBSD.org >WWW : https://github.com/scop/bash-completion >Comment : Programmable completion library for Bash >Options : > BASH_SHARED : on > BASH_STATIC : off > CMAKE_MODULES : on > DOCS : on >Annotations : >Flat size : 1.03MiB >Description : >This is a programmable completion convenience library for the Bash shell. It >features the ability to tab-complete arguments for many common programs. > >Completion functions for FreeBSD-specific software are developed independently >as an extension to the official bash-completion library. The development takes >place on GitHub: https://github.com/0mp/bash-completion-freebsd > >WWW: https://github.com/scop/bash-completion > ># bash -x ># grep --ign # Pressing <Tab> Key. >+ local cur prev words cword split >+ _init_completion -s >+ local exclude= flag outx errx inx OPTIND=1 >+ getopts n:e:o:i:s flag -s >+ case $flag in >+ split=false >+ exclude+== >+ getopts n:e:o:i:s flag -s >+ COMPREPLY=() >+ local 'redir=@(?([0-9])<|?([0-9&])>?(>)|>&)' >+ _get_comp_words_by_ref -n '=<>&' cur prev words cword >+ local exclude flag i OPTIND=1 >+ words=() >+ local cur cword words >+ upargs=() >+ upvars=() >+ local upargs upvars vcur vcword vprev vwords >+ getopts c:i:n:p:w: flag -n '=<>&' cur prev words cword >+ case $flag in >+ exclude='=<>&' >+ getopts c:i:n:p:w: flag -n '=<>&' cur prev words cword >+ [[ 6 -ge 3 ]] >+ case ${!OPTIND} in >+ vcur=cur >+ (( OPTIND += 1 )) >+ [[ 6 -ge 4 ]] >+ case ${!OPTIND} in >+ vprev=prev >+ (( OPTIND += 1 )) >+ [[ 6 -ge 5 ]] >+ case ${!OPTIND} in >+ vwords=words >+ (( OPTIND += 1 )) >+ [[ 6 -ge 6 ]] >+ case ${!OPTIND} in >+ vcword=cword >+ (( OPTIND += 1 )) >+ [[ 6 -ge 7 ]] >+ __get_cword_at_cursor_by_ref '=<>&' words cword cur >+ words=() >+ local cword words >+ __reassemble_comp_words_by_ref '=<>&' words cword >+ local exclude i j line ref >+ [[ -n =<>& ]] >+ exclude='[=<>&]' >+ printf -v cword %s 1 >+ [[ -v exclude ]] >+ line='grep --ign' >+ (( i = 0, j = 0 )) >+ (( i < 2 )) >+ [[ 0 -gt 0 ]] >+ ref='words[0]' >+ printf -v 'words[0]' %s grep >+ line=' --ign' >+ (( i == COMP_CWORD )) >+ (( i++, j++ )) >+ (( i < 2 )) >+ [[ 1 -gt 0 ]] >+ [[ --ign == +([=<>&]) ]] >+ ref='words[1]' >+ printf -v 'words[1]' %s --ign >+ line= >+ (( i == COMP_CWORD )) >+ printf -v cword %s 1 >+ (( i++, j++ )) >+ (( i < 2 )) >+ (( i == COMP_CWORD )) >+ local i cur= index=10 'lead=grep --ign' >+ [[ 10 -gt 0 ]] >+ [[ -n grep --ign ]] >+ [[ -n grep--ign ]] >+ cur='grep --ign' >+ (( i = 0 )) >+ (( i <= cword )) >+ [[ 10 -ge 4 ]] >+ [[ grep != \g\r\e\p ]] >+ (( i < cword )) >+ local old_size=10 >+ cur=' --ign' >+ local new_size=6 >+ (( index -= old_size - new_size )) >+ (( ++i )) >+ (( i <= cword )) >+ [[ 6 -ge 5 ]] >+ [[ --ig != \-\-\i\g\n ]] >+ cur=--ign >+ (( index > 0 )) >+ (( index-- )) >+ [[ 5 -ge 5 ]] >+ [[ --ign != \-\-\i\g\n ]] >+ (( i < cword )) >+ (( ++i )) >+ (( i <= cword )) >+ [[ -n --ign ]] >+ [[ ! -n --ign ]] >+ (( index < 0 )) >+ local words cword cur >+ _upvars -a2 words grep --ign -v cword 1 -v cur --ign >+ (( 10 )) >+ (( 10 )) >+ case $1 in >+ [[ -n 2 ]] >+ printf %d 2 >+ [[ -n words ]] >+ unset -v words >+ eval 'words=("${@:3:2}")' >++ words=("${@:3:2}") >+ shift 4 >+ (( 6 )) >+ case $1 in >+ [[ -n cword ]] >+ unset -v cword >+ eval 'cword="$3"' >++ cword=1 >+ shift 3 >+ (( 3 )) >+ case $1 in >+ [[ -n cur ]] >+ unset -v cur >+ eval 'cur="$3"' >++ cur=--ign >+ shift 3 >+ (( 0 )) >+ [[ -v vcur ]] >+ upvars+=("$vcur") >+ upargs+=(-v $vcur "$cur") >+ [[ -v vcword ]] >+ upvars+=("$vcword") >+ upargs+=(-v $vcword "$cword") >+ [[ -v vprev ]] >+ [[ 1 -ge 1 ]] >+ upvars+=("$vprev") >+ upargs+=(-v $vprev "${words[cword - 1]}") >+ [[ -v vwords ]] >+ upvars+=("$vwords") >+ upargs+=(-a${#words[@]} $vwords ${words+"${words[@]}"}) >+ (( 4 )) >+ local cur cword prev words >+ _upvars -v cur --ign -v cword 1 -v prev grep -a2 words grep --ign >+ (( 13 )) >+ (( 13 )) >+ case $1 in >+ [[ -n cur ]] >+ unset -v cur >+ eval 'cur="$3"' >++ cur=--ign >+ shift 3 >+ (( 10 )) >+ case $1 in >+ [[ -n cword ]] >+ unset -v cword >+ eval 'cword="$3"' >++ cword=1 >+ shift 3 >+ (( 7 )) >+ case $1 in >+ [[ -n prev ]] >+ unset -v prev >+ eval 'prev="$3"' >++ prev=grep >+ shift 3 >+ (( 4 )) >+ case $1 in >+ [[ -n 2 ]] >+ printf %d 2 >+ [[ -n words ]] >+ unset -v words >+ eval 'words=("${@:3:2}")' >++ words=("${@:3:2}") >+ shift 4 >+ (( 0 )) >+ _variables >+ [[ --ign =~ ^(\$(\{[!#]?)?)([A-Za-z0-9_]*)$ ]] >+ [[ --ign =~ ^(\$\{[#!]?)([A-Za-z0-9_]*)\[([^]]*)$ ]] >+ [[ --ign =~ ^\$\{[#!]?[A-Za-z0-9_]*\[.*]$ ]] >+ case ${prev-} in >+ return 1 >+ [[ --ign == @(?([0-9])<|?([0-9&])>?(>)|>&)* ]] >+ [[ grep == @(?([0-9])<|?([0-9&])>?(>)|>&) ]] >+ local i skip >+ (( i = 1 )) >+ (( i < 2 )) >+ [[ --ign == @(?([0-9])<|?([0-9&])>?(>)|>&)* ]] >+ (( i++ )) >+ (( 1 )) >+ (( i < 2 )) >+ (( cword <= 0 )) >+ prev=grep >+ [[ -n false ]] >+ _split_longopt >+ [[ --ign == --?*=* ]] >+ return 1 >+ return 0 >+ case "${prev,,}" in >+ false >+ [[ --ign == -* ]] >+ COMPREPLY=($(compgen -W "$(LC_ALL=C $1 --help 2>&1 | > while read -r line; do > [[ $line =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] && > printf '%s\n' ${BASH_REMATCH[0]} > done)" -- "$cur")) >+++ LC_ALL=C >+++ grep --help >+++ read -r line >+++ [[ Usage: grep [OPTION]... PATTERN [FILE] ... =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ Search for PATTERN in each FILE or standard input. =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ Example: grep -i 'hello world' menu.h main.c =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ '' =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ Regexp selection and interpretation: =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ -E, --extended-regexp PATTERN is an extended regular expression =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --extended-regexp >+++ read -r line >+++ [[ -F, --fixed-strings PATTERN is a set of newline-separated strings =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --fixed-strings >+++ read -r line >+++ [[ -G, --basic-regexp PATTERN is a basic regular expression =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --basic-regexp >+++ read -r line >+++ [[ -P, --perl-regexp PATTERN is a Perl regular expression =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --perl-regexp >+++ read -r line >+++ [[ -e, --regexp=PATTERN use PATTERN as a regular expression =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --regexp= >+++ read -r line >+++ [[ -f, --file=FILE obtain PATTERN from FILE =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --file= >+++ read -r line >+++ [[ -i, --ignore-case ignore case distinctions =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --ignore-case >+++ read -r line >+++ [[ -w, --word-regexp force PATTERN to match only whole words =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --word-regexp >+++ read -r line >+++ [[ -x, --line-regexp force PATTERN to match only whole lines =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --line-regexp >+++ read -r line >+++ [[ -z, --null-data a data line ends in 0 byte, not newline =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --null-data >+++ read -r line >+++ [[ '' =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ Miscellaneous: =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ -s, --no-messages suppress error messages =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --no-messages >+++ read -r line >+++ [[ -v, --invert-match select non-matching lines =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --invert-match >+++ read -r line >+++ [[ -V, --version print version information and exit =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --version >+++ read -r line >+++ [[ --help display this help and exit =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --help >+++ read -r line >+++ [[ -J, --bz2decompress decompress bzip2'ed input before searching =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --bz2decompress >+++ read -r line >+++ [[ -Z, --decompress decompress input before searching (HAVE_LIBZ=1) =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --decompress >+++ read -r line >+++ [[ --mmap use memory-mapped input if possible =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --mmap >+++ read -r line >+++ [[ '' =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ Output control: =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ -m, --max-count=NUM stop after NUM matches =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --max-count= >+++ read -r line >+++ [[ -b, --byte-offset print the byte offset with output lines =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --byte-offset >+++ read -r line >+++ [[ -n, --line-number print line number with output lines =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --line-number >+++ read -r line >+++ [[ --line-buffered flush output on every line =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --line-buffered >+++ read -r line >+++ [[ -H, --with-filename print the filename for each match =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --with-filename >+++ read -r line >+++ [[ -h, --no-filename suppress the prefixing filename on output =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --no-filename >+++ read -r line >+++ [[ --label=LABEL print LABEL as filename for standard input =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --label= >+++ read -r line >+++ [[ -o, --only-matching show only the part of a line matching PATTERN =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --only-matching >+++ read -r line >+++ [[ -q, --quiet, --silent suppress all normal output =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --quiet >+++ read -r line >+++ [[ --binary-files=TYPE assume that binary files are TYPE =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --binary-files= >+++ read -r line >+++ [[ TYPE is 'binary', 'text', or 'without-match' =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ -a, --text equivalent to --binary-files=text =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --text >+++ read -r line >+++ [[ -I equivalent to --binary-files=without-match =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --binary-files= >+++ read -r line >+++ [[ -d, --directories=ACTION how to handle directories =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --directories= >+++ read -r line >+++ [[ ACTION is 'read', 'recurse', or 'skip' =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ -D, --devices=ACTION how to handle devices, FIFOs and sockets =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --devices= >+++ read -r line >+++ [[ ACTION is 'read' or 'skip' =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ -R, -r, --recursive equivalent to --directories=recurse =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --recursive >+++ read -r line >+++ [[ --include=PATTERN files that match PATTERN will be examined =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --include= >+++ read -r line >+++ [[ --exclude=PATTERN files that match PATTERN will be skipped. =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --exclude= >+++ read -r line >+++ [[ --exclude-from=FILE files that match PATTERN in FILE will be skipped. =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --exclude-from= >+++ read -r line >+++ [[ -L, --files-without-match only print FILE names containing no match =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --files-without-match >+++ read -r line >+++ [[ -l, --files-with-matches only print FILE names containing matches =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --files-with-matches >+++ read -r line >+++ [[ -c, --count only print a count of matching lines per FILE =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --count >+++ read -r line >+++ [[ --null print 0 byte after FILE name =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --null >+++ read -r line >+++ [[ '' =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ Context control: =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ -B, --before-context=NUM print NUM lines of leading context =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --before-context= >+++ read -r line >+++ [[ -A, --after-context=NUM print NUM lines of trailing context =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --after-context= >+++ read -r line >+++ [[ -C, --context=NUM print NUM lines of output context =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --context= >+++ read -r line >+++ [[ -NUM same as --context=NUM =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --context= >+++ read -r line >+++ [[ --color[=WHEN], =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --color >+++ read -r line >+++ [[ --colour[=WHEN] use markers to distinguish the matching string =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --colour >+++ read -r line >+++ [[ WHEN may be `always', `never' or `auto'. =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ -U, --binary do not strip CR characters at EOL (MSDOS) =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --binary >+++ read -r line >+++ [[ -u, --unix-byte-offsets report offsets as if CRs were not there (MSDOS) =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --unix-byte-offsets >+++ read -r line >+++ [[ '' =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ `egrep' means `grep -E'. `fgrep' means `grep -F'. =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ With no FILE, or when FILE is -, read standard input. If less than =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ two FILEs given, assume -h. Exit status is 0 if match, 1 if no match, =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ and 2 if trouble. =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ '' =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ Report bugs to <bug-gnu-utils@gnu.org>. =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >++ compgen -W '--extended-regexp >--fixed-strings >--basic-regexp >--perl-regexp >--regexp= >--file= >--ignore-case >--word-regexp >--line-regexp >--null-data >--no-messages >--invert-match >--version >--help >--bz2decompress >--decompress >--mmap >--max-count= >--byte-offset >--line-number >--line-buffered >--with-filename >--no-filename >--label= >--only-matching >--quiet >--binary-files= >--text >--binary-files= >--directories= >--devices= >--recursive >--include= >--exclude= >--exclude-from= >--files-without-match >--files-with-matches >--count >--null >--before-context= >--after-context= >--context= >--context= >--color >--colour >--binary >--unix-byte-offsets' -- --ign >+ [[ --ignore-case == *= ]] >ore-case >#â Completion Works >#===============================================================# ># uname -v | tr "\r\n" " " && uname -p >FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC amd64 ># env LANG="C" bash --version >GNU bash, version 5.1.16(0)-release (amd64-portbld-freebsd13.1) >Copyright (C) 2020 Free Software Foundation, Inc. >License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> > >This is free software; you are free to change and redistribute it. >There is NO WARRANTY, to the extent permitted by law. ># pkg info bash-completion >bash-completion-2.11_1,2 >Name : bash-completion >Version : 2.11_1,2 >Installed on : Sun May 29 16:49:05 2022 MSK >Origin : shells/bash-completion >Architecture : FreeBSD:13:* >Prefix : /usr/local >Categories : shells >Licenses : BSD2CLAUSE, GPLv2+ >Maintainer : sunpoet@FreeBSD.org >WWW : https://github.com/scop/bash-completion >Comment : Programmable completion library for Bash >Options : > BASH_SHARED : on > BASH_STATIC : off > CMAKE_MODULES : on > DOCS : on >Annotations : >Flat size : 1.03MiB >Description : >This is a programmable completion convenience library for the Bash shell. It >features the ability to tab-complete arguments for many common programs. > >Completion functions for FreeBSD-specific software are developed independently >as an extension to the official bash-completion library. The development takes >place on GitHub: https://github.com/0mp/bash-completion-freebsd > >WWW: https://github.com/scop/bash-completion > ># bash -x ># grep --ign # Pressing <Tab> Key. >+ local cur prev words cword split >+ _init_completion -s >+ local exclude= flag outx errx inx OPTIND=1 >+ getopts n:e:o:i:s flag -s >+ case $flag in >+ split=false >+ exclude+== >+ getopts n:e:o:i:s flag -s >+ COMPREPLY=() >+ local 'redir=@(?([0-9])<|?([0-9&])>?(>)|>&)' >+ _get_comp_words_by_ref -n '=<>&' cur prev words cword >+ local exclude flag i OPTIND=1 >+ words=() >+ local cur cword words >+ upargs=() >+ upvars=() >+ local upargs upvars vcur vcword vprev vwords >+ getopts c:i:n:p:w: flag -n '=<>&' cur prev words cword >+ case $flag in >+ exclude='=<>&' >+ getopts c:i:n:p:w: flag -n '=<>&' cur prev words cword >+ [[ 6 -ge 3 ]] >+ case ${!OPTIND} in >+ vcur=cur >+ (( OPTIND += 1 )) >+ [[ 6 -ge 4 ]] >+ case ${!OPTIND} in >+ vprev=prev >+ (( OPTIND += 1 )) >+ [[ 6 -ge 5 ]] >+ case ${!OPTIND} in >+ vwords=words >+ (( OPTIND += 1 )) >+ [[ 6 -ge 6 ]] >+ case ${!OPTIND} in >+ vcword=cword >+ (( OPTIND += 1 )) >+ [[ 6 -ge 7 ]] >+ __get_cword_at_cursor_by_ref '=<>&' words cword cur >+ words=() >+ local cword words >+ __reassemble_comp_words_by_ref '=<>&' words cword >+ local exclude i j line ref >+ [[ -n =<>& ]] >+ exclude='[=<>&]' >+ printf -v cword %s 1 >+ [[ -v exclude ]] >+ line='grep --ign' >+ (( i = 0, j = 0 )) >+ (( i < 2 )) >+ [[ 0 -gt 0 ]] >+ ref='words[0]' >+ printf -v 'words[0]' %s grep >+ line=' --ign' >+ (( i == COMP_CWORD )) >+ (( i++, j++ )) >+ (( i < 2 )) >+ [[ 1 -gt 0 ]] >+ [[ --ign == +([=<>&]) ]] >+ ref='words[1]' >+ printf -v 'words[1]' %s --ign >+ line= >+ (( i == COMP_CWORD )) >+ printf -v cword %s 1 >+ (( i++, j++ )) >+ (( i < 2 )) >+ (( i == COMP_CWORD )) >+ local i cur= index=10 'lead=grep --ign' >+ [[ 10 -gt 0 ]] >+ [[ -n grep --ign ]] >+ [[ -n grep--ign ]] >+ cur='grep --ign' >+ (( i = 0 )) >+ (( i <= cword )) >+ [[ 10 -ge 4 ]] >+ [[ grep != \g\r\e\p ]] >+ (( i < cword )) >+ local old_size=10 >+ cur=' --ign' >+ local new_size=6 >+ (( index -= old_size - new_size )) >+ (( ++i )) >+ (( i <= cword )) >+ [[ 6 -ge 5 ]] >+ [[ --ig != \-\-\i\g\n ]] >+ cur=--ign >+ (( index > 0 )) >+ (( index-- )) >+ [[ 5 -ge 5 ]] >+ [[ --ign != \-\-\i\g\n ]] >+ (( i < cword )) >+ (( ++i )) >+ (( i <= cword )) >+ [[ -n --ign ]] >+ [[ ! -n --ign ]] >+ (( index < 0 )) >+ local words cword cur >+ _upvars -a2 words grep --ign -v cword 1 -v cur --ign >+ (( 10 )) >+ (( 10 )) >+ case $1 in >+ [[ -n 2 ]] >+ printf %d 2 >+ [[ -n words ]] >+ unset -v words >+ eval 'words=("${@:3:2}")' >++ words=("${@:3:2}") >+ shift 4 >+ (( 6 )) >+ case $1 in >+ [[ -n cword ]] >+ unset -v cword >+ eval 'cword="$3"' >++ cword=1 >+ shift 3 >+ (( 3 )) >+ case $1 in >+ [[ -n cur ]] >+ unset -v cur >+ eval 'cur="$3"' >++ cur=--ign >+ shift 3 >+ (( 0 )) >+ [[ -v vcur ]] >+ upvars+=("$vcur") >+ upargs+=(-v $vcur "$cur") >+ [[ -v vcword ]] >+ upvars+=("$vcword") >+ upargs+=(-v $vcword "$cword") >+ [[ -v vprev ]] >+ [[ 1 -ge 1 ]] >+ upvars+=("$vprev") >+ upargs+=(-v $vprev "${words[cword - 1]}") >+ [[ -v vwords ]] >+ upvars+=("$vwords") >+ upargs+=(-a${#words[@]} $vwords ${words+"${words[@]}"}) >+ (( 4 )) >+ local cur cword prev words >+ _upvars -v cur --ign -v cword 1 -v prev grep -a2 words grep --ign >+ (( 13 )) >+ (( 13 )) >+ case $1 in >+ [[ -n cur ]] >+ unset -v cur >+ eval 'cur="$3"' >++ cur=--ign >+ shift 3 >+ (( 10 )) >+ case $1 in >+ [[ -n cword ]] >+ unset -v cword >+ eval 'cword="$3"' >++ cword=1 >+ shift 3 >+ (( 7 )) >+ case $1 in >+ [[ -n prev ]] >+ unset -v prev >+ eval 'prev="$3"' >++ prev=grep >+ shift 3 >+ (( 4 )) >+ case $1 in >+ [[ -n 2 ]] >+ printf %d 2 >+ [[ -n words ]] >+ unset -v words >+ eval 'words=("${@:3:2}")' >++ words=("${@:3:2}") >+ shift 4 >+ (( 0 )) >+ _variables >+ [[ --ign =~ ^(\$(\{[!#]?)?)([A-Za-z0-9_]*)$ ]] >+ [[ --ign =~ ^(\$\{[#!]?)([A-Za-z0-9_]*)\[([^]]*)$ ]] >+ [[ --ign =~ ^\$\{[#!]?[A-Za-z0-9_]*\[.*]$ ]] >+ case ${prev-} in >+ return 1 >+ [[ --ign == @(?([0-9])<|?([0-9&])>?(>)|>&)* ]] >+ [[ grep == @(?([0-9])<|?([0-9&])>?(>)|>&) ]] >+ local i skip >+ (( i = 1 )) >+ (( i < 2 )) >+ [[ --ign == @(?([0-9])<|?([0-9&])>?(>)|>&)* ]] >+ (( i++ )) >+ (( 1 )) >+ (( i < 2 )) >+ (( cword <= 0 )) >+ prev=grep >+ [[ -n false ]] >+ _split_longopt >+ [[ --ign == --?*=* ]] >+ return 1 >+ return 0 >+ case "${prev,,}" in >+ false >+ [[ --ign == -* ]] >+ COMPREPLY=($(compgen -W "$(LC_ALL=C $1 --help 2>&1 | > while read -r line; do > [[ $line =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] && > printf '%s\n' ${BASH_REMATCH[0]} > done)" -- "$cur")) >+++ LC_ALL=C >+++ grep --help >+++ read -r line >+++ [[ usage: grep [-abcDEFGHhIiLlmnOoPqRSsUVvwxz] [-A num] [-B num] [-C num] =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ read -r line >+++ [[ [-e pattern] [-f file] [--binary-files=value] [--color=when] =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --binary-files= >+++ read -r line >+++ [[ [--context=num] [--directories=action] [--label] [--line-buffered] =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --context= >+++ read -r line >+++ [[ [--null] [pattern] [file ...] =~ --[A-Za-z0-9]+([-_][A-Za-z0-9]+)*=? ]] >+++ printf '%s\n' --null >+++ read -r line >++ compgen -W '--binary-files= >--context= >--null' -- --ign >+ [[ '' == *= ]] >#â Completion Fails >#===============================================================#
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 264592
: 234598