Ticket #973 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

user commands only get last argument

Reported by: Flupp Owned by:
Priority: Sometime Milestone:
Component: clients/cave Version: 0.54.0
Keywords: Cc:
Blocked By: Blocking:
Distribution: Gentoo

Description

User commands in '/usr/libexec/cave/commands' do not get all the parameters as documented ( http://paludis.pioto.org/clients/cave.html).

User command (myarguments.bash):

#!/bin/bash

declare -i I=0

for A in "${0}" "${@}"
do
        echo "Parameter ${I}: ${A}"
        I+=1
done

actual behavior:

$ cave myarguments 1 2
Parameter 0: /usr/libexec/cave/commands/myarguments.bash
Parameter 1: 2

expected behavior:

$ cave myarguments 1 2
Parameter 0: /usr/libexec/cave/commands/myarguments.bash
Parameter 1: 1
Parameter 2: 2

example when directly calling script:

$ ./myarguments.bash 1 2
Parameter 0: ./myarguments.bash
Parameter 1: 1
Parameter 2: 2

Change History

comment:1 Changed 8 years ago by ciaranm

  • Status changed from new to closed
  • Resolution set to fixed

Ah, this is what's known as a really silly bug.

Note: See TracTickets for help on using tickets.