From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from ol0router01.airtag.info ([88.190.231.88]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1TIdDf-0004lJ-Qi for ptxdist@pengutronix.de; Mon, 01 Oct 2012 12:27:24 +0200 Received: from HQ0SBS01.airtag.local (hq0sbs01.airtag.local [10.4.0.10]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (Client CN "*.airtag.com", Issuer "GlobalSign Organization Validation CA - G2" (verified OK)) by ol0router01.airtag.info (Postfix) with ESMTPS id 9AD3B1FA19E for ; Mon, 1 Oct 2012 12:26:10 +0200 (CEST) Date: Mon, 1 Oct 2012 12:25:16 +0200 From: =?ISO-8859-15?Q?Beno=EEt_Burnichon?= In-Reply-To: <20120930130205.GC19651@pengutronix.de> Message-ID: References: <1348844873-23722-1-git-send-email-benoit.burnichon@airtag.com> <20120930130205.GC19651@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="67767296-1635506294-1349087121=:11001" Subject: Re: [ptxdist] [PATCH] Allow p link to be completed Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de --67767296-1635506294-1349087121=:11001 Content-Type: text/plain; charset="iso-8859-1"; format="flowed" Content-Transfer-Encoding: quoted-printable On Sun, 30 Sep 2012, Michael Olbrich wrote: > On Fri, Sep 28, 2012 at 05:07:53PM +0200, Beno=EEt Burnichon wrote: >> _ptxdist_completion() >> { >> - local cur cmds opts >> + local cur cmds opts _ptxdist_cmd >> + >> + if [ -h './p' ]; then >> + _ptxdist_cmd=3D$(readlink ./p) >> + else >> + _ptxdist_cmd=3Dptxdist >> + fi > > if [ "${COMP_WORDS[0]}" =3D "ptxdist ]; then > _ptxdist_cmd=3Dptxdist > else > _ptxdist_cmd=3D"$(readlink "${COMP_WORDS[0]}")" > fi > > I think. This way we're not limited to ./p > Or maybe just '_ptxdist_cmd=3D"${COMP_WORDS[0]}"'. I'm not sure if there = is > actually a case when the readlink is needed. > Fine with removing limitation to only ./p Kept the readlink command as there is a case where it does not work. Suppose you are only type p in your project directory then press ,=20 there will be an issue because the called ptxdist will be p in the current = directory and bash will not find the ptxdist script as it is not in the=20 current directory >> complete -F _ptxdist_completion ptxdist >> +complete -F _ptxdist_completion p > > I'm not sure if this last change is a good idea by default. 'p' is rather > ambiguous. But if we merge the rest, then it's easy to add just this line > to ~/.bash_completion > You're probably right, this is not good idea. Let the users configures=20 their own bash_completion to whatever name they choose. Beno=EEt --67767296-1635506294-1349087121=:11001 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- ptxdist mailing list ptxdist@pengutronix.de --67767296-1635506294-1349087121=:11001--