Cannot use 'set -s' in bjorne

Project:JNode Shell
Component:Code
Category:bug report
Priority:normal
Assigned:Stephen Crawley
Status:closed
Description

This problem was noted by cluster on another issue.

The root problem is that we've overloaded 'set'. There is a jnode command called 'set' with the following syntax:

   set <name> [ <value> ]          # set or remove System property
   set -s <name> [ <value> ]       # set or remove Shell property

but in bjorne there is a POSIX builtin with the syntax

   set [ <opts&gt ] <name>=<value>  # set a Shell variable

When you are using bjorne, the latter syntax masks the former and ... you cannot change jnode.interpreter.

#1

I've checked in a workaround which is to make 'propset' an alias for classic JNode 'set'. But I don't think this is the complete answer. IMO, it is a bad idea to have conflicting syntaxes for a core command. Here are some possible ways to address this:

  • Make 'propset' the command for setting properties, getting rid of the 'set' alias entirely.
  • Change the options for the classic JNode 'set' command so that its syntax is "compatible" with POSIX set; i.e. using options that don't conflict denote System and Shell properties. Then add the same options to the bjorne 'set' builtin.
  • Leave things as they are and remove classic 'set' if/when the 'redirecting' and 'default' interpreters are removed.

I prefer the first solution. It is less work and more robust than the second solution, and the third solution assumes that we want to entirely get rid of the primitive interpreters in the long run.

If people have other ideas / views, please comment.

#2

I say change the name. It's a namespace conflict.

#3

`propset` is in, and there's been no objections, can we mark this fixed?

#4

Status:active» fixed

OK. I'll delete the 'set' alias and mark this as fixed.

#5

Status:fixed» closed

Manually closed.