MRtrix3 / mrtrix3

MRtrix3 provides a set of tools to perform various advanced diffusion MRI analyses, including constrained spherical deconvolution (CSD), probabilistic tractography, track-density imaging, and apparent fibre density
http://www.mrtrix.org
Mozilla Public License 2.0
295 stars 182 forks source link

Deprecate REQUIRES_AT_LEAST_ONE_ARGUMENT? #2814

Open Lestropie opened 9 months ago

Lestropie commented 9 months ago

Been thinking a lot about CLI lately due to #2678.

One feature of the MRtrix3 CLI that I was recently reminded is absent from the Python API is the REQUIRES_AT_LEAST_ONE_ARGUMENT flag. Normally, running a command without any positional arguments triggers display of the help page. However in some circumstances one wants to be able to run a command without any arguments. Hence this flag exists to prevent triggering the help page.

However it occurs to me that this potentially should not be necessary at all. In the situations where it needs to be possible to run a command with no arguments, there will either be no positional arguments specified, or there will be one positional argument with the .optional() flag. So it should be possible, when a user runs a command with no arguments, to interrogate the command interface, and only if there's at least one compulsory argument will the help page trigger.