[ditz-talk] Some work on ditz
ohad at lutzky.net
Wed Jul 30 18:42:58 EDT 2008
On Wed, Jul 30, 2008 at 03:03:29PM -0700, William Morgan wrote:
> Reformatted excerpts from Ohad Lutzky's message of 2008-07-30:
> > Well, config is currently a custom object (why, by the way?), whereas
> > trollop just gives us a hash. It would be possible to merge them,
> > manually adding fields for anything we need, but I'm not sure what
> > we'd gain.
> Whoops, I meant $opts and opts, not config and opts. Do away with the
> global, and have one hash that contains global and subcommand options.
> Config can stay as it is. (It's a ModelObject because that allows us to
> interactively create it when needs be.)
I'm not sure having one hash for both global and subcommand options would
work well. For example, you'll want the following two commands to behave
ditz -v commit ditz-1 # Be verbose about ditz's initialization
ditz commit -v ditz-1 # Add patchlog to commit-message buffer
> > This would work if trollop weren't hardwired to work with ARGV.
> > However, currently Trollop's "options" sends all of his parameters on
> > to Trollop::Parser.initialize, which in turn passes them to cloaker,
> > and I have no idea what that does :)
> I think that for subcommand arguments, we want to construct a
> Trollop::Parser of our own anyways, since we probably want to handle
> things like HelpNeeded and VersionNeeded specially. Not sure.
Hey, yeah, ditz cmd --help could just go ahead and do ditz help cmd :)
> I kinda forget where I was going with the parameters to
> Trollop::options. Doesn't look like they're used. If that's really true,
> it could just take a single argument that defaults to ARGV instead.
Will do. I'll have any remaining arguments passed on as they are now.
More information about the ditz-talk