Alan Agius 82ec1af4e1 fix(@angular/cli): show more actionable error when command is ran in wrong scope
Currently, we don't register all available commands. For instance, when the CLI is ran inside a workspace the `new` command is not registered. Thus, this will cause a confusing error message when `ng new` is ran inside a workspace.

Example:
```
$ ng new
Error: Unknown command. Did you mean e?
```

With this commit we change this by registering all the commands and valid the command scope during the command building phase which is only triggered once the command is invoked but prior to the execution phase.
2022-06-13 19:22:56 +02:00
..