mne-tools/mne-python — pull request #868 by yarikoptic (2013-11-03 01:57:19+00:00)
Title: Enh/cmdline handling enhancements

Since I was at fault for all the big RF decided to chime in with further (tentative) improvements

1. ENH: use straight subprocess.call instead of 'handling' stout/stderr

pros:
- no buffering on output
- probably would make things easier to debug since no stdout/stderr redirection

cons:
- no 'beautification' of stdout to replace mne_ with mne and stripping .py suffix

Also exits with correct return code returned by the call (could have been done
in original version too)

2. DOC: adjusting usage examples to use 'mne command' instead of 'mne_command.py'

also added space in ```$ mne...``` so not to confuse with some env variable

3. ENH: centralize definition of OptionParser to deduce command name and set version, etc fields

With changes to mne_surf2bem as a demo "case"

This should allow to set correct program "name" to "mne command", effectively reuse file's ```.__doc__``` for command line description etc, and to avoid handling of --version in each script separately. If you like it -- adjust other commands __doc__ and initiation of optionparser the same way