nuke icon indicating copy to clipboard operation
nuke copied to clipboard

Extend `nuke --help` to show the accepted values for parameters

Open BusHero opened this issue 2 years ago • 1 comments

Description

As a user I would like to see what values parameters are accepting when running nuke --help So that I don't have to guess how correctly to use a parameter.

Currently, nuke doesn't show what values parameters are accepting. This makes it harder to use parameters, as you have either to guess what values a parameter is accepting or look in other places(ex .nuke\build.schema.json, source files, etc.) for the accepted values. The problem becomes obvious when trying to use some lesser used parameters(ex. --verbosity) and when working with an unfamiliar code base that uses nuke.

By adding the accepted values(or data types?) to the description of parameters when running nuke --help, it will make it simpler for the user to run nuke.

Here is what it can look like:

Parameters:

  --continue(switch)                                           Indicates to continue a previously failed build attempt.
  --profile(string)                                            Defines the profiles to load.
  --verbosity(''Minimal', 'Quiet', 'Normal', 'Verbose')        Logging verbosity during build execution. Default is 'Normal'.
  --root(AbsolutePath)                                         Root directory during build execution.

Usage Example

> nuke --help
...
Parameters:

  --continue(switch)                                    Indicates to continue a previously failed build attempt.
  --profile(string)                                     Defines the profiles to load.
  --verbosity(''Minimal', 'Quiet', 'Normal', 'Verbose') Logging verbosity during build execution. Default is 'Normal'.
  --root(AbsolutePath)                                  Root directory during build execution.

Alternative

  • Include the accepted values in the description of each parameter.
  • Trust nuke's completer to suggest the right value(works for enums)
  • look in .nuke\build.schema.json
  • search through the projects source files

Could you help with a pull-request?

Yes

BusHero avatar Aug 27 '23 18:08 BusHero

A Target to Parameter mapping can also be useful. is should be best to accept a parameter list as Fluent method on the Target definition just list we do for Required parameters

JinsPeter avatar Sep 04 '23 13:09 JinsPeter