[ditz-talk] Operator Arguments

William Morgan wmorgan-ditz at masanjin.net
Mon Jun 9 18:53:49 EDT 2008

Reformatted excerpts from Daniel Hackney's message of 2008-06-08:
> I am currently working on the "operator-arguments" branch on
> Gitorious, and have a whole lot more work that isn't yet there, but I
> am wondering about some development decisions.

Great! I'd love to have per-operator arguments.

> 1. Would a single patch of the whole change, rebased off of the
> current head be best, or would a patch for each operator be preferred?

A patch for each logical set of changes, preferrably with each resulting
in a working system. (To the extent that it's not overly cumbersome.)

> 2. Is it still a good idea to have all of the operators in the same
> big file, or could I break them out into one file per operation (in a
> subdirectory most likely)?

I'd like to keep small ones in one file, but larger ones could be broken

> 3. Would it be okay to drop the dependency on Trollop and add CmdParse
> [cmdparse.rubyforge.org], which is also packaged as a Gem?

Definitely not. I wrote Trollop because cmdparse and all the other Ruby
option parsers are clumsy and Java-esque.

I actually have a reasonably simple plan for inserting operator
arguments into ditz.

1. Patch trollop so that it takes a set of words which stop argument
   processing at that point.
2. In ditz, give trollop the set of commands as that set of words.
3. For each command that takes arguments, re-invoke trollop with the set
   of command-specific arguments.

> One of my goals is to be able to create a "batch mode" where some
> option (like "-b") could be passed to ditz to tell it never to ask the
> user any questions, for use with a frontend like emacs. This would not
> have to happen with the first revision of the operator-argument
> branch, but it could be useful.

I'd love to have this too. Most of the user input (besides asking for
comments) is actually invoked programmatically by
ModelObject.create_interactively, so having e.g. a set of commandline
arguments that specify the needed text is fairly straight-forward.
William <wmorgan-ditz at masanjin.net>

More information about the ditz-talk mailing list