Thursday, November 8, 2007

ctioga's new options shortcuts

I implemented today something I had in mind for a long time: a way to pass options in a slightly more convenient way to ctioga. I'm thinking mainly about the pain of writing, say,

ctioga --math --math-samples 200 'sin(x)'

when one would rather like to write

ctioga --math --samples 200 'sin(x)'

Starting from SVN revision 637, the latter form is possible. Specifically, when an option is not recognised, ctioga tries the following:

  • if it looks like a shortcut, ctioga uses a shortcut
  • if it corresponds to an option of the current backend (such as --samples for --math-samples), the corresponding option is used
  • failing that, ctioga complains

You can see the beauty of these options in the attached graph, produced by:

ctioga --xpdf --math --samples 200 \
  --cloud --filled 'sin(x)'

No comments: