[Opensim-dev] Organization and naming patterns of commands on the console
Gary Chernega
chernega at us.ibm.com
Wed Feb 4 21:13:05 UTC 2009
A common parsing routine that used keywords as commands and triggered off
of those would work best.
show users: >> users module receives: show
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.
users show: >> users module receives: show
The parser stripped module (users) from beginning, and passed
remainder of text line
region load oar \filespec -x 123 -y 234: >> region module would
receive: load oar \filespec -x 123 -y 234
Parser only parses off the module, and the command module decides what to
do with what it gets.
So -> help region is functionally the same as region help
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)
Am I clear enough in plain text?
Justin Clark-Casey <jjustincc at googlemail.com>
Sent by: opensim-dev-bounces at lists.berlios.de
02/04/2009 03:50 PM
Please respond to
opensim-dev at lists.berlios.de
To
opensim-dev at lists.berlios.de
cc
Subject
[Opensim-dev] Organization and naming patterns of commands on the console
Hello,
I want to add more commands to the archiving module but I want to do this
within the module itself rather than adding
any specific logic to core.
The terrain module already has a 'module commander' to help do this, but
this prefixes all commands with the word
terrain (e.g. terrain fill, terrain load, etc.)
For consistency purposes, eventually I think that all console commands
should largely follow the same pattern. If we
the terrain module scheme, then we get the following kinds of changes (if
we assume that commands from different modules
can actually share the same initial 'keyword')
backup => region backup
create user => user create
create-region => region create
help users => user help (for user commands)
show assets => assets show
show users => user show
load-xml => region xml load (?)
load-oar => region oar load (?)
kickuser => user kick
I think that the pros of this approach are that it makes it easy to avoid
name collisions and easy to distribute
commands to the right module. The console seem to include the fact that
it's not very intuitive (e.g. show users seems
easier to remember than user show) and it involves more typing in some
cases (e.g. region xml load rather than load-xml
or load xml).
Any thoughts on this? Just kind of thinking about it at this stage - part
of me prefers typing things like "show users"
or "help terrain" while another part of my mind likes the 'tidiness' of
prefixing every module command with the same
word (e.g. terrain fill or region oar load).
--
justincc
Justin Clark-Casey
http://justincc.wordpress.com
_______________________________________________
Opensim-dev mailing list
Opensim-dev at lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20090204/61c22a3e/attachment-0001.html>
More information about the Opensim-dev
mailing list