← Back to team overview

calibre-devs team mailing list archive

Re: Modularization: The Empire Strikes Back!

 

On Saturday 07 February 2009 10:07:41 Marshall T. Vandegrift wrote:
> On Sat, Feb 7, 2009 at 12:57 PM, Kovid Goyal <kovid@xxxxxxxxxxxxxx> wrote:
> > where the order of arguments is significant. The available options
> > will be adjusted based on the types of the input and output file
> > names.
>
> Hmm.  Ok.  Not a big change required to my proposed interfaces.  But how
> is documentation for the options going to be exposed?  If
> 'ebook-convert' doesn't know what options are available unless it's
> provided filenames, how will '--help' work?
> I'm 100% with hanging all conversion off of a single command, but
> perhaps something like the increasingly-common "<command> <subcommand>"
> interface would be more appropriate?  Readers have no options, then the
> <subcommand> specifies a particular conversion pipeline.  Plugins can
> provide their own pipelines.  So:
>
>     ebook-convert mobi [OPTIONS] BOOK
>
> Etc.  Doing "ebook-convert --help" would list available pipelines and
> doing "ebook-convert mobi --help" would list the options for Mobipocket
> generation, etc.

command subcommand

is really only needed if the subcommands do widely different things from each 
other. Since we're trying to keep the Readers/Writers as simple as possible, 
they should ideally have only a few options that will not change their 
behavior too much.

--help will work by using calibre's plugin system to generate a list of all 
the input/output formats and their associated help texts and appending that to 
the list of  options for the available transformations. Since there are only a 
handful of writers and most readers wont have options, this shouldn't make the 
help text too cumbersome. 

Kovid.

-- 
_____________________________________

Kovid Goyal  MC 452-48
California Institute of Technology
1200 E California Blvd
Pasadena, CA 91125

cell  : +01 626 390 8699
office: +01 626 395 6595 (449 Lauritsen)
email : kovid@xxxxxxxxxxxxxxxxxx
web   : http://www.kovidgoyal.net
_____________________________________




Follow ups

References