Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/cue: avoid loading the current package in
cue help
Loading a CUE package is necessary for `cue help cmd`, as the inline comment now explains. However, it was done for any help invocation, even for those which did not need to list available `cue cmd` commands such as `cue help` or `cue -h`. There's already a regression test for `cue help cmd` showing available commands in _tools.cue files, which continues to pass. Other help commands are unaffected in behavior, but are cheaper now. For example, in our ./internal/ci package which contains CUE commands: $ time cue help >/dev/null real 0m1.972s user 0m3.519s sys 0m0.083s and after the change: $ time cue help >/dev/null real 0m0.006s user 0m0.000s sys 0m0.006s Fixes #2161. Signed-off-by: Daniel Martí <mvdan@mvdan.cc> Change-Id: I5cd4942e6874550b9f7b3e51f80cc7ffd54a1cfd Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/552250 Reviewed-by: Roger Peppe <rogpeppe@gmail.com> Unity-Result: CUEcueckoo <cueckoo@cuelang.org> TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
- Loading branch information