Found this while running `./vagrant box` with no args to get the help
output. It turns out you can have an empty RunResult but also a nil
error. I took the occasion to unwind the conditional tree a bit which
hopefully makes it a bit easier to read.
In legacy Vagrant, any exception raised that's a subclass of
Vagrant::Errors::VagrantError is considered user-facing and so causes
the error message to be printed to the console and the process to use
exit code 1. Anything outside of that causes the process to use exit
code 255. (See `bin/vagrant` for the code.)
Here we mirror that behavior by treating errors that have a
LocalizedMessage as user-facing and those without as unexpected. This
allows the basic virtualbox component to pass in vagrant-spec!
* `vagrant ssh` has a --no-tty flag colliding with the one defined in
`bin/vagrant` - in fact none of the flags in `bin/vagrant` are
processed in `serve` mode, so remove the code that captures them from
the CommandInfo OptionParser dance
* `vagrant ssh` has a `--plain` flag colliding with the one defined in
`internal/cli/base.go` - this flag was inherited from Waypoint, so we
can just rename it to line up with the (inversely defined) `--color`
flag used in legacy vagrant
* Makes all help output showup on stdout like in rubyland
* Moves verbosity flags to capital Vs to get out of the way of version
* Passes version down to mitchellh/cli so it handles -v and --version
flags
* Tweaks version output to remove the leading `v` which is not output
in legacy vagrant
Having the modules stored in `./vendor` causes issues with `go mod`.
Follow waypoint's convention to store in `./thirdparty` and grab
the same Makefile modifications to alert when the submodules need
to be initialized. Update generators to use new path.
There are still some things left to address like how to handle
a target (or targets) and if that is something we should even
be doing. It may be best to just let the command deal with
target loading. There are also some considerations to make
around remote source.
Use the UI provided by the built client instead of creating a
new one. Add support for an extra `v` flag when enabling logging
via flag. An exclude function is added to the logger to prevent
outputting log lines where the content is extremely long for trace
messages. Adding the extra `v` will prevent the suppression and
all log output will be displayed.