[Top][All Lists]

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

Re: using perl's gnu-readline interface, howto 'completion' & 'filter hi

From: Linda Walsh
Subject: Re: using perl's gnu-readline interface, howto 'completion' & 'filter history'?
Date: Fri, 09 Jan 2015 14:19:27 -0800
User-agent: Thunderbird

Andreas Schwab wrote:

The default completion function is filename completion.  If you want
something different you need to write your own.
        Yes... so I look for a 'complete' function that I
can call with my options (or to choose some set of supplied
choices, like usernames or hostnames) -- but minimally, the
readline call I would use to set the options I want returned.

        But... I don't see a complete call in readline.

That's why I asked the question.

I wasn't expecting to "source" /<bash-completion-dir>/*.sh
and have bash shell commands interpret correctly in perl.

I don't see how to supply choices, or choose a non-default
set (like dir's only, or files ending in .gz, only).

How do I call the bash equiv of 'complete' in order to communicate
my 'choice(s)' to readline?

Meanwhile, in the semi-snarky department:

...  write my own?  Really?  My own code to make my own
custom selections -- what a primitive interface.

I always preferred 'smart' interfaces like:

sub read_users_mind {
  my mind_src="/dev/mind"
if [[ ! -c $mind_src || ! -O $mind_src ]]; then # be sure to only read our own mind_src=$(echo ~/.mind-backups/dflt-overrides) # hope we made a backup!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]