You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Derek Baum (JIRA)" <ji...@apache.org> on 2009/07/14 01:18:14 UTC
[jira] Updated: (FELIX-1325) gogo doesn't report a command not
found error unless an argument is supplied
[ https://issues.apache.org/jira/browse/FELIX-1325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Derek Baum updated FELIX-1325:
------------------------------
Attachment: FELIX-1325.patch
I attach the full patch including update to tests for this change.
I will not commit it for a few days to allow time for comments from the dev list.
Many of the tests made extreme use of command evaluation defaulting to the value if not found.
For example:
assertEquals("a b", c.execute("echo ${c} b | capture"));
here the ${c} forces c to be evaluated as a command, which now fails with command not found
assertEquals("3", c.execute("[a=2 <b>=<3>] get b").toString());
here the <b> and <3> would now fail as b and 3 are not defined as commands
assertEquals("a", c.execute("e = { echo $0 } ; <e a b | capture>"));
here e a b produces a, but the <> cause a to be evaluated again, which fails as it is not defined as a command.
> 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
> Assignee: Derek Baum
> Priority: Minor
> Attachments: FELIX-1325.patch
>
>
> 2009/7/13 Hiram Chirino <ch...@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.