Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Melanie
The backspace issue is easily solved. Some termcap configurations 
use BS, some use DEL. If your terminal sends DEL while the host 
expects BS, you will get the observed behavior.
Typing CTRL-H will send the correct character and allow backspacing. 
Windows terminal emulators often provide a BS is DEL and/or DEL is 
BS setting.

Melanie

Dahlia Trimble wrote:
> I always liked a feature often seen on some older unix terminal based
> programs, like some curses based IRC clients, where just typing enough
> characters of a command to resolve any ambiguity would give you the complete
> command, and where the help section is  nicely organized. It sounds to be
> like that may be what you are describing?
> Another issue I find, not sure if it's related or not, is the inability to
> use the backspace key in the OpenSim console while running on various linux
> distributions. I don't know where this is coming from, but I wonder if it's
> something OpenSim could control?
> 
> 
> On Thu, Feb 5, 2009 at 10:28 AM, Stefan Andersson 
> wrote:
> 
>>  Just chipping in my 2c:
>>
>> How about the modules are supposed to register the 'command' whatever that
>> is, but that the 'command' can include spaces?
>>
>> So, "create user" should be a valid command, sending the remainder to that
>> region (via the registered delegate).
>>
>> which means another module can register "create region" but not "create
>> user", as that would have already been registered.
>>
>> Of course, it cannot register a non-character terminated subset either,
>> like simply "create".
>>
>> the command parser would simply run thru the list, doing a 'starts with
>> characters' match, probably with a non-character terminator in the regexp.
>>
>> (If you're really anal on performance, the whole list of matches can be
>> concatenated into a regexp and compiled once)
>>
>> Of course, you would have to register "help create user" as well, but it
>> seems to me that there could be an abstract base class providing some
>> protected generative helper functions.
>>
>> (To either create and register verb+" "+noun and/or noun+" "+verb, and the
>> corresponding help text in one go)
>>
>> This seems like the most flexible approach to me, as it poses no
>> limitations on what commands makes the most sense for each context.
>>
>> Best regards,
>> Stefan Andersson
>> Tribal Media AB
>>
>> > Date: Thu, 5 Feb 2009 18:30:25 +0100
>> > From: drscofi...@xyzzyxyzzy.net
>> > To: opensim-dev@lists.berlios.de
>> > Subject: Re: [Opensim-dev] Organization and naming patterns of commands
>> on the console
>>
>> >
>> > Justin Clark-Casey wrote:
>> > > Ai Austin wrote:
>> > >> Any chance we can have the verb first, as this is much more intuitive?
>> E.g.
>> > >> create user
>> > >> create region
>> >
>> > i prefer addressing the entity that is supposed to do something first (to
>> get
>> > it's attention, so to speak), then tell it what to do:
>> >
>> > region create
>> > user create
>> > user reset password
>> >
>> > that approach also has the advantage that it's up to the module what
>> vocabulary
>> > to support.
>> >
>> > --
>> > dr dirk husemann  virtual worlds research  ibm zurich research
>> lab
>> > SL: dr scofield  drscofi...@xyzzyxyzzy.net 
>> http://xyzzyxyzzy.net/
>> > RL: h...@zurich.ibm.com - +41 44 724 8573 -
>> http://www.zurich.ibm.com/~hud/
>> > ___
>> > Opensim-dev mailing list
>> > Opensim-dev@lists.berlios.de
>> > https://lists.berlios.de/mailman/listinfo/opensim-dev
>>
>>
>> ___
>> Opensim-dev mailing list
>> Opensim-dev@lists.berlios.de
>> https://lists.berlios.de/mailman/listinfo/opensim-dev
>>
>>
> 
> 
> 
> 
> ___
> Opensim-dev mailing list
> Opensim-dev@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Stefan Andersson

Well, I don't mean anything that advanced; It just struck me that commands 
could just as well contain spaces.
 Best regards,Stefan AnderssonTribal Media AB

Date: Thu, 5 Feb 2009 10:53:26 -0800From: dahliatrim...@gmail.comto: 
opensim-...@lists.berlios.desubject: Re: [Opensim-dev] Organization and naming 
patterns of commands on the consoleI always liked a feature often seen on some 
older unix terminal based programs, like some curses based IRC clients, where 
just typing enough characters of a command to resolve any ambiguity would give 
you the complete command, and where the help section is  nicely organized. It 
sounds to be like that may be what you are describing?

Another issue I find, not sure if it's related or not, is the inability to use 
the backspace key in the OpenSim console while running on various linux 
distributions. I don't know where this is coming from, but I wonder if it's 
something OpenSim could control?

On Thu, Feb 5, 2009 at 10:28 AM, Stefan Andersson  wrote:

Just chipping in my 2c: How about the modules are supposed to register the 
'command' whatever that is, but that the 'command' can include spaces? So, 
"create user" should be a valid command, sending the remainder to that region 
(via the registered delegate). which means another module can register "create 
region" but not "create user", as that would have already been registered. Of 
course, it cannot register a non-character terminated subset either, like 
simply "create". the command parser would simply run thru the list, doing a 
'starts with characters' match, probably with a non-character terminator in the 
regexp. (If you're really anal on performance, the whole list of matches can be 
concatenated into a regexp and compiled once) Of course, you would have to 
register "help create user" as well, but it seems to me that there could be an 
abstract base class providing some protected generative helper functions. (To 
either create and register verb+" "+noun and/or noun+" "+verb, and the 
corresponding help text in one go)This seems like the most flexible approach to 
me, as it poses no limitations on what commands makes the most sense for each 
context.Best regards,Stefan AnderssonTribal Media AB> Date: Thu, 5 Feb 2009 
18:30:25 +0100> From: drscofi...@xyzzyxyzzy.net
> To: opensim-dev@lists.berlios.de> Subject: Re: [Opensim-dev] Organization and 
> naming patterns of commands on the console


> > Justin Clark-Casey wrote:> > Ai Austin wrote:> >> Any chance we can have 
> > the verb first, as this is much more intuitive? E.g.> >> create user> >> 
> > create region> > i prefer addressing the entity that is supposed to do 
> > something first (to get> it's attention, so to speak), then tell it what to 
> > do:> > region create> user create> user reset password> > that approach 
> > also has the advantage that it's up to the module what vocabulary> to 
> > support.> > -- > dr dirk husemann  virtual worlds research  ibm 
> > zurich research lab> SL: dr scofield  drscofi...@xyzzyxyzzy.net  
> > http://xyzzyxyzzy.net/> RL: h...@zurich.ibm.com - +41 44 724 8573 - 
> > http://www.zurich.ibm.com/~hud/> 
> > ___> Opensim-dev mailing list> 
> > Opensim-dev@lists.berlios.de> 
> > https://lists.berlios.de/mailman/listinfo/opensim-dev___Opensim-dev
> >  mailing 
> > listopensim-...@lists.berlios.dehttps://lists.berlios.de/mailman/listinfo/opensim-dev___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Dahlia Trimble
I always liked a feature often seen on some older unix terminal based
programs, like some curses based IRC clients, where just typing enough
characters of a command to resolve any ambiguity would give you the complete
command, and where the help section is  nicely organized. It sounds to be
like that may be what you are describing?
Another issue I find, not sure if it's related or not, is the inability to
use the backspace key in the OpenSim console while running on various linux
distributions. I don't know where this is coming from, but I wonder if it's
something OpenSim could control?


On Thu, Feb 5, 2009 at 10:28 AM, Stefan Andersson wrote:

>  Just chipping in my 2c:
>
> How about the modules are supposed to register the 'command' whatever that
> is, but that the 'command' can include spaces?
>
> So, "create user" should be a valid command, sending the remainder to that
> region (via the registered delegate).
>
> which means another module can register "create region" but not "create
> user", as that would have already been registered.
>
> Of course, it cannot register a non-character terminated subset either,
> like simply "create".
>
> the command parser would simply run thru the list, doing a 'starts with
> characters' match, probably with a non-character terminator in the regexp.
>
> (If you're really anal on performance, the whole list of matches can be
> concatenated into a regexp and compiled once)
>
> Of course, you would have to register "help create user" as well, but it
> seems to me that there could be an abstract base class providing some
> protected generative helper functions.
>
> (To either create and register verb+" "+noun and/or noun+" "+verb, and the
> corresponding help text in one go)
>
> This seems like the most flexible approach to me, as it poses no
> limitations on what commands makes the most sense for each context.
>
> Best regards,
> Stefan Andersson
> Tribal Media AB
>
> > Date: Thu, 5 Feb 2009 18:30:25 +0100
> > From: drscofi...@xyzzyxyzzy.net
> > To: opensim-dev@lists.berlios.de
> > Subject: Re: [Opensim-dev] Organization and naming patterns of commands
> on the console
>
> >
> > Justin Clark-Casey wrote:
> > > Ai Austin wrote:
> > >> Any chance we can have the verb first, as this is much more intuitive?
> E.g.
> > >> create user
> > >> create region
> >
> > i prefer addressing the entity that is supposed to do something first (to
> get
> > it's attention, so to speak), then tell it what to do:
> >
> > region create
> > user create
> > user reset password
> >
> > that approach also has the advantage that it's up to the module what
> vocabulary
> > to support.
> >
> > --
> > dr dirk husemann  virtual worlds research  ibm zurich research
> lab
> > SL: dr scofield  drscofi...@xyzzyxyzzy.net 
> http://xyzzyxyzzy.net/
> > RL: h...@zurich.ibm.com - +41 44 724 8573 -
> http://www.zurich.ibm.com/~hud/
> > ___
> > Opensim-dev mailing list
> > Opensim-dev@lists.berlios.de
> > https://lists.berlios.de/mailman/listinfo/opensim-dev
>
>
> ___
> Opensim-dev mailing list
> Opensim-dev@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
>
>
___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Stefan Andersson

Just chipping in my 2c:
 
How about the modules are supposed to register the 'command' whatever that is, 
but that the 'command' can include spaces?
 
So, "create user" should be a valid command, sending the remainder to that 
region (via the registered delegate).
 
which means another module can register "create region" but not "create user", 
as that would have already been registered.
 
Of course, it cannot register a non-character terminated subset either, like 
simply "create".
 
the command parser would simply run thru the list, doing a 'starts with 
characters' match, probably with a non-character terminator in the regexp.
 
(If you're really anal on performance, the whole list of matches can be 
concatenated into a regexp and compiled once)
 
Of course, you would have to register "help create user" as well, but it seems 
to me that there could be an abstract base class providing some protected 
generative helper functions.
 
(To either create and register verb+" "+noun and/or noun+" "+verb, and the 
corresponding help text in one go)
This seems like the most flexible approach to me, as it poses no limitations on 
what commands makes the most sense for each context.
Best regards,Stefan AnderssonTribal Media AB
> Date: Thu, 5 Feb 2009 18:30:25 +0100> From: drscofi...@xyzzyxyzzy.net> To: 
> opensim-dev@lists.berlios.de> Subject: Re: [Opensim-dev] Organization and 
> naming patterns of commands on the console> > Justin Clark-Casey wrote:> > Ai 
> Austin wrote:> >> Any chance we can have the verb first, as this is much more 
> intuitive? E.g.> >> create user> >> create region> > i prefer addressing the 
> entity that is supposed to do something first (to get> it's attention, so to 
> speak), then tell it what to do:> > region create> user create> user reset 
> password> > that approach also has the advantage that it's up to the module 
> what vocabulary> to support.> > -- > dr dirk husemann  virtual worlds 
> research  ibm zurich research lab> SL: dr scofield  
> drscofi...@xyzzyxyzzy.net  http://xyzzyxyzzy.net/> RL: 
> h...@zurich.ibm.com - +41 44 724 8573 - http://www.zurich.ibm.com/~hud/> 
> ___> Opensim-dev mailing list> 
> Opensim-dev@lists.berlios.de> 
> https://lists.berlios.de/mailman/listinfo/opensim-dev___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Dr Scofield
Justin Clark-Casey wrote:
> Ai Austin wrote:
>> Any chance we can have the verb first, as this is much more intuitive?  E.g.
>>   create user
>>   create region

i prefer addressing the entity that is supposed to do something first (to get
it's attention, so to speak), then tell it what to do:

region create
user create
user reset password

that approach also has the advantage that it's up to the module what vocabulary
to support.

-- 
dr dirk husemann  virtual worlds research  ibm zurich research lab
SL: dr scofield  drscofi...@xyzzyxyzzy.net  http://xyzzyxyzzy.net/
RL: h...@zurich.ibm.com - +41 44 724 8573 - http://www.zurich.ibm.com/~hud/
___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Dr Scofield
Justin Clark-Casey wrote:
> Gary Chernega wrote:
>> 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?
> 
> I see where you're going, although I'm not a great fan of "there's more than 
> one way to execute that command", since it 
> complicates the code and potentially the documentation.

me neither... reminds me a bit of an uncle of my wife (philosophy prof) who once
claimed that logically the sentences

"the lion roars"

and

"the roar lions"

would be the same... nobody quite believed him for some strange reason...

-- 
dr dirk husemann  virtual worlds research  ibm zurich research lab
SL: dr scofield  drscofi...@xyzzyxyzzy.net  http://xyzzyxyzzy.net/
RL: h...@zurich.ibm.com - +41 44 724 8573 - http://www.zurich.ibm.com/~hud/
___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Dr Scofield
Justin Clark-Casey wrote:
> 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).
> 

+1 from me.

-- 
dr dirk husemann  virtual worlds research  ibm zurich research lab
SL: dr scofield  drscofi...@xyzzyxyzzy.net  http://xyzzyxyzzy.net/
RL: h...@zurich.ibm.com - +41 44 724 8573 - http://www.zurich.ibm.com/~hud/
___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Justin Clark-Casey
Gary Chernega wrote:
> 
> 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?

I see where you're going, although I'm not a great fan of "there's more than 
one way to execute that command", since it 
complicates the code and potentially the documentation.

> 
> 
> 
> 
> *Justin Clark-Casey *
> Sent by: opensim-dev-boun...@lists.berlios.de
> 
> 02/04/2009 03:50 PM
> Please respond to
> opensim-dev@lists.berlios.de
> 
> 
>   
> To
>   opensim-dev@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@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev
> 
> 
> 
> 
> ___
> Opensim-dev mailing list
> Opensim-dev@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev


-- 
justincc
Justin Clark-Casey
http://justincc.wordpress.com
___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Justin Clark-Casey
krtaylor wrote:
> Justin, I like this idea - it also greatly simplifies the initial help, 
> which can simply refer the user to the sub command helps - e.g. user 
> help  These new sub command helps can then be much more lengthy if need 
> be...

Yes, in fact providing better command line help (at least for the archiving 
stuff initially) is my immediate driver for 
this.

Of course, what we ultimately need is a separate console program for executing 
commands, in the same manner that 
database packages have these command line programs for administering different 
databases.  I know someone/people were 
working on that a while back.  However, as far as I can see there are currently 
lots of little awkwardnesses in OpenSim 
that prevent this being easily done at the moment (though I hope these will 
ease with time).

> 
> Justin Clark-Casey wrote:
>> 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@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Justin Clark-Casey
Dalien Talbot wrote:
> 
> 
> On Wed, Feb 4, 2009 at 9:50 PM, Justin Clark-Casey 
> mailto:jjusti...@googlemail.com>> wrote:
> 
> 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).
> 
> 
> I think it depends on what kinds of evils to choose :)
> 
> using the first keyword to select the handler to throw the remainder of 
> the string to, is a very nice decoupled approach from the code 
> perspective, and is the most flexible and simple (the analogy is 
> argc/argv passing from the shell, the first token being the executable 
> int the path). The obvious downsides, that the standardization ends 
> immediately beyond the first level :-)
> 
> the standardization "by action" is more convenient at least to some part 
> of the users. will require some more code indeed, also.

Yeah, I agree.  However, I'm coming to the opinion that the only keyword really 
worth any formal code-based 
standardization is help (so that you can reliably get help on topics and then 
individual commands in modules).  All the 
rest I'd be happy to see as just guidelines (e.g. show, create, delete 
keywords) which can be consistent in the core 
modules.

Thinking about it a bit more, the initial keyword approach works well for some 
modules (e.g. terrain) and not so well 
for other stuff.  So I'm tending to favour an approach where modules register 
whatever commands they like without any 
leading keyword.  Interpretation of the arguments to those commands could be 
left to the module or perhaps there could 
be some standard core mechanism using some external project 
(http://sourceforge.net/projects/csharpoptparse/ perhaps).

Despite talking about this, I don't have any personal intention of 
implementing/changing lots of stuff any time soon - 
I'm probably just going to do what I need to do to achieve my own immediate 
selfish aims without committing too much of 
a code atrocity :).  I was more interested in the discussion and seeing the 
direction in which we could go as modules 
get more popular and we start to factor out more stuff into them.

> 
> the "embedded standard" solution would be a full-blown parser with 
> contextual "?"-help - then the modules can use the benefits of grouping 
> by action without scattering the code too much - as they'd register the 
> callbacks from the parser tree. As well then the token 
> representation/quoting/escaping/etc. could be standard and uniform. But 
> that's the most code-heavy approach and my guess is you're not really 
> looking forward to that at all :)

You're most preceptive :)  I'm hoping that we can keep things as simple as 
possible and largely offload parsing to 
something like csharpoptparse.

-- 
justincc
Justin Clark-Casey
http://justincc.wordpress.com
___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Salahzar Stenvaag
+1 on having a clear *and* documented interface for console commands.
I think that the "verb + target" paradigm is much more universal in Unix,
SQL (create Table, not table create) and people can remember easily.
Also commands should help people in understand why there are similar
commands save-xml save-xml2 save-oar and the meanings of some obscure ones.
In case of errors also some hints, for instance "create" shoud prompt for a
list of available "create" objects...
Should this be a good start?
___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Justin Clark-Casey
Ai Austin wrote:
> Any chance we can have the verb first, as this is much more intuitive?  E.g.
>   create user
>   create region
> 
> Also, we really want to then avoid having some commands with hyphen 
> if some do not.  That awkward to get right . I always  do 
> "create-user" and then realise it does not work. E,g, 
> "command-script  would have to be changed

I hear you - I'm also personally starting to favour a solution that doesn't 
require an initial module keyword (though 
then ideally one has to try and catch clashes between modules which try and 
register the same command).

I also know what you mean about the inconsistency - I do hope that will clear 
up eventually (at least within core), but 
it's actually quite a chore to correct because of the various ad hoc parsing of 
commands that goes on.

> 
> Another thing...  if the command is not recognized or has parameter 
> issues, just now it just comes back to the prompt.  A little 
> acknowledgement that the command is not recognized would be nice.

I agree.  Unfortunately, there is again quite a bit of messiness in the code 
that prevent this being easily done right now.

-- 
justincc
Justin Clark-Casey
http://justincc.wordpress.com
___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread krtaylor
Justin, I like this idea - it also greatly simplifies the initial help, 
which can simply refer the user to the sub command helps - e.g. user 
help  These new sub command helps can then be much more lengthy if need 
be...

Justin Clark-Casey wrote:
> 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).
>   
-- 
Kurt Taylor (Kurt Stringer)


___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-05 Thread Ai Austin
Any chance we can have the verb first, as this is much more intuitive?  E.g.
  create user
  create region

Also, we really want to then avoid having some commands with hyphen 
if some do not.  That awkward to get right . I always  do 
"create-user" and then realise it does not work. E,g, 
"command-script  would have to be changed

Another thing...  if the command is not recognized or has parameter 
issues, just now it just comes back to the prompt.  A little 
acknowledgement that the command is not recognized would be nice.

___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-04 Thread Dalien Talbot
On Wed, Feb 4, 2009 at 9:50 PM, Justin Clark-Casey  wrote:

> 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).


I think it depends on what kinds of evils to choose :)

using the first keyword to select the handler to throw the remainder of the
string to, is a very nice decoupled approach from the code perspective, and
is the most flexible and simple (the analogy is argc/argv passing from the
shell, the first token being the executable int the path). The obvious
downsides, that the standardization ends immediately beyond the first level
:-)

the standardization "by action" is more convenient at least to some part of
the users. will require some more code indeed, also.

the "embedded standard" solution would be a full-blown parser with
contextual "?"-help - then the modules can use the benefits of grouping by
action without scattering the code too much - as they'd register the
callbacks from the parser tree. As well then the token
representation/quoting/escaping/etc. could be standard and uniform. But
that's the most code-heavy approach and my guess is you're not really
looking forward to that at all :)

/d
___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


Re: [Opensim-dev] Organization and naming patterns of commands on the console

2009-02-04 Thread Gary Chernega
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  
Sent by: opensim-dev-boun...@lists.berlios.de
02/04/2009 03:50 PM
Please respond to
opensim-dev@lists.berlios.de


To
opensim-dev@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@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev

___
Opensim-dev mailing list
Opensim-dev@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev


[Opensim-dev] Organization and naming patterns of commands on the console

2009-02-04 Thread Justin Clark-Casey
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@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/opensim-dev