felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Baum (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (FELIX-1325) gogo doesn't report a command not found error unless an argument is supplied
Date Thu, 30 Jul 2009 09:51:15 GMT

     [ https://issues.apache.org/jira/browse/FELIX-1325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Derek Baum reassigned FELIX-1325:
---------------------------------

    Assignee:     (was: Derek Baum)

Guillaume Nodet wrote:
> I think we should really keep the fact that ${c} is equivalent to $c
> I'll try to dig a bit and find a better way to report error not founds while still supporting
${c}.

I agree.

currently '${' is parsed as two tokens, so {} defines a closure and then the $ executes the
closure.

The problem is that we need a 'command not found' error when executing a closure fails,
except when we are using ${x} just for variable expansion, as we didn't really want to define
a closure anyway.

One way to achieve this would be to change the parser to recognise '${' as a single token,
and then use this for variable expansion. We could then also support default value substitution
like bash e.g. ${myvar:-default value}.



> gogo doesn't report a command not found error unless an argument is supplied
> ----------------------------------------------------------------------------
>
>                 Key: FELIX-1325
>                 URL: https://issues.apache.org/jira/browse/FELIX-1325
>             Project: Felix
>          Issue Type: Improvement
>          Components: Gogo
>            Reporter: Derek Baum
>            Priority: Minor
>         Attachments: FELIX-1325.patch
>
>
> 2009/7/13 Hiram Chirino <chirino@gmail.com> wrote:
>     But on related note... to the gogo developers: I would have expected a
>     command not found error when you type in a command that's not found.  This
>     seems to work fine if you pass an argument to a command.  It this a 'feature' or
a bug?
> This is a 'feature', in that an undefined command silently returns itself, rather than
an error.
> This is so that:
> > x = hello
> works; otherwise the assignment would fail, with a command not found error.
> Note: that
> > x = hello world
> will actually evaluate the 'hello' command with 'world' as an argument.
> > x = "hello world"
> tries to evaulate the 'hello world' command, which probably doesn't exist, so it falls
back to returning the value, rather than unknown command.
> I think this can be simply resolved by avoiding re-evaluating an assignment with a single
argument.
> This will mean that
> > x = hello
> works as it does currently, but that
> > hello
> will fail with 'unknown command', rather than simply return itself.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message