From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
Git List <git@vger.kernel.org>
Subject: Re: [QUERY] How do you sort completions?
Date: Tue, 28 May 2013 12:23:03 +0200 [thread overview]
Message-ID: <20130528102303.GC2192@goldbirke> (raw)
In-Reply-To: <CAMP44s3_BBPu0WSzYyaVLbdg0dBuaV7MFgy1SMuK1C8P2vKbYg@mail.gmail.com>
Hi,
On Fri, May 24, 2013 at 08:11:00AM -0500, Felipe Contreras wrote:
> AFAIK bash needs the completions sorted, so we added some | sort |
> uniq.
Actually, it seems to sort and remove duplicates automatically:
$ _foo () { COMPREPLY=("bar" "foo" "bar" "baz") ; }
$ complete -F _foo foo
$ foo <TAB>
bar baz foo
So that | sort | uniq might not be necessary after all, and by
removing them we could spare two fork()+exec()s.
I'm not sure all supported Bash versions behave this way, though.
Best,
Gábor
next prev parent reply other threads:[~2013-05-28 10:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-24 11:33 [QUERY] How do you sort completions? Ramkumar Ramachandra
2013-05-24 13:11 ` Felipe Contreras
2013-05-28 10:23 ` SZEDER Gábor [this message]
2013-05-24 16:12 ` SZEDER Gábor
2013-05-24 16:18 ` Ramkumar Ramachandra
2013-05-24 16:22 ` Antoine Pelisse
2013-05-24 18:26 ` Ramkumar Ramachandra
2013-05-24 18:20 ` Marc Khouzam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130528102303.GC2192@goldbirke \
--to=szeder@ira.uka.de \
--cc=artagnon@gmail.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).