[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bash-completion pros/cons (was: Re: Need commands)



On Tue, 16 Jun 2020, l0f4r0@tuta.io wrote:

16 juin 2020 à 10:47 de davidson@freevolt.org:

I hear some people find bash-completion helpful. Personally, though,
no. Do not want.

Interesting/intriguing point of view.

I will remember this polite new way to call somebody a weirdo.

Why would someone not be interested in autocompletion please?

I am perfectly happy with autocompletion in general. Disabling
bash-completion package does not mean one must peck out their bash
command lines verbatim, character-by-character, as one must in grub
rescue shell. Others have also pointed this out.

I use a lot of the autocompletion (and command history) functionality
described in bash(1), under the sections

 * READLINE:Completing
 * READLINE:Commands for Manipulating the History
 * HISTORY EXPANSION

Those functions are agnostic: No matter what particular fragmentary
command presently awaits completion (manual or otherwise), their
behavior does not vary. And their very agnosticism is significant; it
is largely why learning the shape of their behavior, and how to take
advantage of it, has been worth the time and effort.

Now consider the following:

bash(1), section READLINE:Programmable Completion (AKA progcomp)
  [...]
  By default, if a compspec is found, whatever it generates is
  returned to the completion code as the full set of possible
  completions.  The default bash completions are not attempted, and
  the readline default of filename completion is disabled.  If the -o
  bashdefault option was supplied to complete when the compspec was
  defined, the bash default completions are attempted if the compspec
  generates no matches.  If the -o default option was supplied to
  complete when the compspec was defined, readline's default
  completion will be performed if the compspec (and, if attempted, the
  default bash completions) generate no matches.
  [...]

In other words, with progcomp I can (and the bash-completion package
does) lay booby-traps that will override the behavior I've become so
accustomed to.

I might, in specialised context, choose to do this. But when any
exceptional behavior has been specified by myself, then I know who to
blame for the surprises. (And my own mistakes teach me things much
more reliably than the mistakes of others.)

In the shell I'm trying to play a nice orderly game of croquet. If
there are going to be mines under the lawn, I want to install them
myself, carefully.

When I want someone to surprise me there is always NetHack.

--
 \ '   .----------------------------------------,
 o O  /  It looks like you're writing a letter!  )
     /     Would you like some help?            /
  Y : \.______________________________________./

Reply to: