<br><font size=2 face="sans-serif">A common parsing routine that used keywords
as commands and triggered off of those would work best.</font>
<br>
<br><font size=2 face="sans-serif">show users: >>
users module receives: show</font>
<br><font size=2 face="sans-serif"> The
parser would be looking for the module level first (users etc), and since
it is the 2nd word, it would strip it, and pass the remaining text to the
users module.</font>
<br>
<br><font size=2 face="sans-serif">users show: >>
users module receives: show</font>
<br><font size=2 face="sans-serif"> The
parser stripped module (users) from beginning, and passed remainder of
text line</font>
<br>
<br><font size=2 face="sans-serif">region load oar \filespec -x 123 -y
234: >> region module would receive:
load oar \filespec -x 123 -y 234</font>
<br>
<br><font size=2 face="sans-serif">Parser only parses off the module, and
the command module decides what to do with what it gets.</font>
<br>
<br><font size=2 face="sans-serif">So -> help region is
functionally the same as region help</font>
<br><font size=2 face="sans-serif">Or -> region load oar
zzyy == load oar region zzyy == load oar zzyy region
(since region is stripped out no matter where it is, and remainder is passed
to region command handler)</font>
<br>
<br><font size=2 face="sans-serif">Am I clear enough in plain text?</font>
<br><font size=2 face="sans-serif"><br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Justin Clark-Casey <jjustincc@googlemail.com></b>
</font>
<br><font size=1 face="sans-serif">Sent by: opensim-dev-bounces@lists.berlios.de</font>
<p><font size=1 face="sans-serif">02/04/2009 03:50 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
opensim-dev@lists.berlios.de</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">opensim-dev@lists.berlios.de</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">[Opensim-dev] Organization and naming
patterns of commands on the console</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><tt><font size=2>Hello,<br>
<br>
I want to add more commands to the archiving module but I want to do this
within the module itself rather than adding <br>
any specific logic to core.<br>
<br>
The terrain module already has a 'module commander' to help do this, but
this prefixes all commands with the word <br>
terrain (e.g. terrain fill, terrain load, etc.)<br>
<br>
For consistency purposes, eventually I think that all console commands
should largely follow the same pattern. If we <br>
the terrain module scheme, then we get the following kinds of changes (if
we assume that commands from different modules <br>
can actually share the same initial 'keyword')<br>
<br>
backup
=> region backup<br>
create user
=> user create<br>
create-region
=> region create<br>
help users
=> user help (for user commands)<br>
show assets
=> assets show<br>
show users
=> user show<br>
load-xml
=> region xml load (?)<br>
load-oar
=> region oar load (?)<br>
kickuser
=> user kick<br>
<br>
I think that the pros of this approach are that it makes it easy to avoid
name collisions and easy to distribute <br>
commands to the right module. The console seem to include the fact
that it's not very intuitive (e.g. show users seems <br>
easier to remember than user show) and it involves more typing in some
cases (e.g. region xml load rather than load-xml <br>
or load xml).<br>
<br>
Any thoughts on this? Just kind of thinking about it at this stage
- part of me prefers typing things like "show users" <br>
or "help terrain" while another part of my mind likes the 'tidiness'
of prefixing every module command with the same <br>
word (e.g. terrain fill or region oar load).<br>
<br>
-- <br>
justincc<br>
Justin Clark-Casey<br>
http://justincc.wordpress.com<br>
_______________________________________________<br>
Opensim-dev mailing list<br>
Opensim-dev@lists.berlios.de<br>
https://lists.berlios.de/mailman/listinfo/opensim-dev<br>
</font></tt>
<br>