[prev in list] [next in list] [prev in thread] [next in thread]
List: gentoo-dev
Subject: Re: [gentoo-dev] [PATCH] bash-completion-r1: support for aliasing completions for commands
From: Alexander Kapshuk <alexander.kapshuk () gmail ! com>
Date: 2014-08-27 16:37:59
Message-ID: CAJ1xhMVKYuW5EZ=pbenXfWPSSzMKiZ+-w_WWaC2wpFZGMF9p6Q () mail ! gmail ! com
[Download RAW message or body]
On Wed, Aug 27, 2014 at 7:32 PM, Alexander Kapshuk
<alexander.kapshuk@gmail.com> wrote:
> On Wed, Aug 27, 2014 at 7:01 PM, Bertrand Jacquin <beber@meleeweb.net> wrote:
>> Hi Michał,
>>
>> On 2014-08-27 17:06, Michał Górny wrote:
>>
>>> Please review.
>>
>>
>>> +bashcomp_alias() {
>>> + debug-print-function ${FUNCNAME} "${@}"
>>> +
>>> + [[ ${#} -lt 2 ]] && die "Usage: ${FUNCNAME} <basename> <alias>..."
>>> + local base=${1} f
>>> + shift
>>> +
>>> + for f; do
>>
>>
>> is there a missing 'in "$@" after 'for f' ? f is never initialized.
>>
>>
>>> + dosym "${base}"
>>> "$(_bash-completion-r1_get_bashcompdir)/${f}"
>>> + done
>>> +}
>>
>>
>> --
>> Beber
>>
>
> bash(1)
> for name [ [ in [ word ... ] ] ; ] do list ; done
> <snip>
> If the in word is omitted, the for command
> executes list once for each positional
> parameter that is set (see PARAMETERS below).
Here's a test run:
cat test4loop
#!/bin/sh
for f
do echo $f
done
sh -x test4loop 1 2 3
+ for f in '"$@"'
+ echo 1
1
+ for f in '"$@"'
+ echo 2
2
+ for f in '"$@"'
+ echo 3
3
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic