CABLE-LSM / benchcab

Tool for evaluation of CABLE land surface model
https://benchcab.readthedocs.io/en/latest/
Apache License 2.0
2 stars 3 forks source link

Implement parse and dispatch strategy for executing subcommands #196

Closed SeanBryan51 closed 10 months ago

SeanBryan51 commented 11 months ago

The current method of executing subcommands can be improved using a "parse and dispatch" strategy. Whereby you don't need to run a conditional to work out which subcommand to use.

See: https://github.com/AusClimateService/axiom/blob/54de78d3c490800bdf6806e15a1e8d23f2e82430/bin/axiom#L207

I basically set the desired command as a default on the sub parser and then pop it to call when dispatching.

https://github.com/AusClimateService/axiom/blob/54de78d3c490800bdf6806e15a1e8d23f2e82430/bin/axiom#L15

Originally posted by @bschroeter in https://github.com/CABLE-LSM/benchcab/pull/191#pullrequestreview-1707340422