[Bug 264592] BSD Grep & BASH-Completion

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 10 Jun 2022 11:34:28 UTC

            Bug ID: 264592
           Summary: BSD Grep & BASH-Completion
           Product: Base System
           Version: 13.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: CrazyMihey@Ya.Ru

Created attachment 234598
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=234598&action=edit
bash -x: Working Logs

After migrating from GNU Grep to BSD Grep (FreeBSD 13+), the «grep --help»
command began to issue a shortened list of parameters, like «grep -h». This
prevents the BASH-Completion PlugIn from Complementing the Command Keys. Please
provide a Detailed Description of the Keys with the «grep --help» Command, if
only for the sake of COMPATIBILITY with such a Wonderful Thing as
BASH-Completion. The same goes for egrep, fgrep, rgrep, and pgrep (It gave a
brief hint before).
BASH-Completion breaks after «grep --help»
It would be Great if egrep, fgrep and rgrep also work with
«/ports/shells/bash-completion». Despite the fact that grep, egrep, fgrep,
rgrep are Hard Links to One Binary File («find "$(dirname -- "$(whereis -b -q
"grep")")" -samefile "$(whereis -b -q "grep")"»), egrep Options have never been
completed with BASH-Completion before (I don't know, Why).
I'm not sure if the InCompatibility is only caused by Grep behavior, a
BSD-Patch for "/usr/ports/shells/bash-completion" might be needed…

P.S. Found, that egrep Completion can be made just by adding «complete -F
_longopt "egrep" "fgrep" "rgrep"» into «~/.bashrc» in FreeBSD 12.1 (not in
P.P.S. I understand, FreeBSD uses CSH (TCSH) by Default, but I do not think,
that All FreeBSD Fans MUST use TCSH or OpenBSD Fans MUST use KSH. I Spent a
Month! Trying to BeFriend TCSH and MidNigth ComManDer, then installed BASH.
BASH needs just one Option «HISTCONTROL="ignorespace:erasedups"» to keep
History Clean of MC Commands and two more Options «bind '"\e[A"
History-Search-BackWard'» & «bind '"\e[B" History-Search-ForWard'» to NaviGate
the History, like TCSH.

You are receiving this mail because:
You are the assignee for the bug.