ewels / clusterflow

A pipelining tool to automate and standardise bioinformatics analyses on cluster environments.
https://ewels.github.io/clusterflow/
GNU General Public License v3.0
97 stars 27 forks source link

Use command line argument flags instead of positions for modules #29

Closed ewels closed 9 years ago

ewels commented 9 years ago

At the moment, modules receive most of the information that they need in a positional @ARGV array. This is a bit messy and easy to get into trouble with.

It would be nicer to use --flags to do this instead. However, these flags really need to be processed within the Helpers.pm function load_runfile_params(). Individual modules need to process some flags individually first though (--cores and --mem and so on).

Can we partially pass the options in the module first and then do the remaining ones in the load_runfile_params() function? Maybe this could work?

use Getopt::Long;
Getopt::Long::Configure("pass_through");

Then minimal module changes will be needed (just the extra config).

This all clears the way to make the summary modules work easier.

ewels commented 9 years ago

Better still, get load_runfile_params() to handle the entire Getopt processing. Depending on what it returns, the module can return its requirements or execute.

ewels commented 9 years ago

Do we even need to pass @parameters on the command line? These are written to the run file, which we're already parsing anyway. Might be good to get rid of these..

ewels commented 9 years ago

Done as part of #47 (see PR #56)