[ditz-talk] Some work on ditz

William Morgan wmorgan-ditz at masanjin.net
Wed Jul 30 16:25:19 EDT 2008

Reformatted excerpts from Ohad Lutzky's message of 2008-07-29:
> So - other ideas? Elucidate away :)

Looking at your branch, you have exactly the new syntax for
Operator#operation that I wanted:

 -  operation :help, "List all registered commands", :maybe_command
 -  def help project, config, command
 +  operation :help, "List all registered commands", :maybe_command do
 +    opt :cow, "Activate super cow powers", :default => false
 +  end
 +  def help project, config, opts, command

So, nice work.

I'm also considering the idea of having opts just merge with config, so
the command only has one source of options. Unless there's a real reason
for the command to distinguish between global and command-specific
options. Thoughts?

The only other comment I have is that instead of replacing args with
ARGV everywhere in operator.rb, I'd prefer you just pass ARGV to
Operator#do in bin/ditz. That way Operator is insulated from where its
arguments actually came from. (You can imagine other uses that don't
involve ARGV.) Since all gets calls are now called on $stdin explicitly,
it shouldn't be a problem to just pass ARGV around.
William <wmorgan-ditz at masanjin.net>

More information about the ditz-talk mailing list