Spun off from #3600
Nextflow should be able to validate CLI params (and params file) against the params defined by the pipeline. This is tricky because params can be defined across multiple configs and even in the pipeline itself. But I think a good solution would be:
- Parse CLI options, eagerly accept unmatched options as params
- Parse config files, which produces a full set of params
- Warn the user if a CLI "param" was not defined by the config file
- Ignore params defined in the pipeline, it is mainly a shorthand and should not be the source of truth for production pipelines
I am talking mainly about the param name, not the type. We could try to infer the type from the param value as defined in the config, but that will not always work. For that we really need a way to annotate params with a type declaration.