cmd/cue: suggest `cue mod fix` when `language.version` is missing
That is, if a user tries to use `mod tidy`, `mod get`, or `mod publish`
on a module without a `language.version` field, which is now mandatory,
suggest what the user should run to resolve that issue.
Note that we don't apply this change to non-mod commands such as
`cue export` because, as the TODOs explain, those scenarios should work
for the sake of backwards compatibility as a downstream user.
We also don't try to make this be consistent for all `cue mod` commands
as it's not clear that all of them should require `language.version`.
For example, `mod init` creates a module, `mod fix` can add the field,
and we should arguably teach `mod edit` to add or set the field too.
For now, add the suggestion to the three `cue mod` commands which are
most likely to be used when developing or publishing a CUE module.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: I11cef96900b2a5984ad6c07abbd705108c2c2759
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1195784
Reviewed-by: Paul Jolly <paul@myitcv.io>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>