I've pushed a change to github master that I hope will fix these problems:
https://github.com/mozilla/rhino/commit/5ce561e1be528d55485c49a2858fbb41d1ad4d6c
Here's what's changed:
1) The -main option to define the main module has been removed. If
commonjs module support is enabled and a script is passed on the
command line it is the main module. If more than one scripts are
defined (using the -f option) the last one is used as main module.
2) There's now a -require command line option to enable commonjs
modules without having to using any of the other module related
options like -modules. Those other options imply the -require switch,
so it's only needed if you don't want to define a module search path.
3) Relative module ids are now supported in non-module command line
scripts, shell input and code provided through the -e option. For
ordinary scripts, relative ids are resolved relative to the script's
file name or URL. For shell and -e option, relative ids are resoved
relative to the current working directory.
Let me know what you think of these changes.
Hannes
Tim
2011/12/21 Hannes Wallnöfer <han...@gmail.com>: