#28 Command line parsing


Added and used two functions to get a command line option (a "flag") and an option with a value in order to reduce repeated code.

In the long run command line parsing should be done central and with `optparse` (or maybe `wx.CmdLineParser`?). This might need some changes in the way plugins get at command line options though, because `optparse` needs to know all possible options before parsing the command line. One possibility would be an option for plugin options. For example::

--plugin-options 'opt1 "opt 1" opt2'

The option's value could be parsed with `shlex` and bound to `sys.argv` after parsing the options for the main program. This way there would be no difference for existing plugins. Although I think that all accepted options should be known at parsing time, that is very early in the application's life cycle. Applications should fail with misspelled options and not ignore them.


  • Franz Steinhaeusler

    Thanks, is in svn

  • Franz Steinhaeusler

    • status: open --> open-accepted
  • Franz Steinhaeusler

    • status: open-accepted --> closed-accepted

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks