mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] fix typo in bash_completion
Date: Fri, 14 Dec 2012 11:18:33 +0100	[thread overview]
Message-ID: <20121214101833.GG32091@pengutronix.de> (raw)
In-Reply-To: <C3F05FE7-A9FC-4DA3-A3D4-A345BD63CB4B@etit.tu-chemnitz.de>

Hi,

On Thu, Dec 13, 2012 at 01:10:33PM +0100, Daniel Kriesten wrote:
> may be you can once more lend my a hand …
> 
> As my Mac has Bash version 3, which is AFAIK deprecated for bash completion,
> I changed the script just to fit my needs.
> 
> On my linux box (recent Gentoo, bash 4.2.37) the issue is an other. If I log
> in, the completion is not loaded. If I start a new shell, the completion
> works. This seems to be related to the line
> 
> if have ptxdist
> 
> and the way Gentoo handles bash completion and the way I installed ptxdist.
> As far as I can see, ptxdist is not in the path when the completion scripts
> are executed at login as this is done by the global /etc/profile early in
> session startup. Simply removing the if statement solves this for me. But I
> guess there is a reason to check for ptxdist?

The ptxdist bash_completion script should not be sourced directly. 'have'
is defined by bash_completion before it sources the application specific
scripts and later undefined. At least that's how it works on Debian. I have
a .bash_completion like this:
--------------------------------------
. /path/to/ptxdist/scripts/bash_completion

complete -F _ptxdist_completion p
--------------------------------------

Note: for this to work 'ptxdist' must be found in PATH when this is loaded.
I suppose you could also define 'have' in a way that it is always
successful before sourcing scripts/bash_completion

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2012-12-14 10:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-08 16:35 Daniel Kriesten
2012-12-10  8:50 ` Michael Olbrich
2012-12-11 15:16   ` Daniel Kriesten
2012-12-13 12:10     ` Daniel Kriesten
2012-12-14 10:18       ` Michael Olbrich [this message]
2012-12-14 12:28         ` Daniel Kriesten

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=20121214101833.GG32091@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /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