43 Commits

Author SHA1 Message Date
sophia
d062e03d97 Force all boolean flags to have a negative alias 2022-05-18 15:13:58 -05:00
sophia
887903c0e1 Set aliases for command flags 2022-05-17 14:06:04 -05:00
sophia
584e7d2913 Make flag --no-tty 2022-05-17 14:04:18 -05:00
sophia
108275de21 Set default values for flags 2022-05-16 16:19:40 -05:00
sophia
1b8246c28f Set base command flag data 2022-05-16 14:56:22 -05:00
sophia
df25af809c Use no-tty flag 2022-05-16 13:52:52 -05:00
sophia
26fac3e1d9 Setup noninteractive ui for the base command if the --no-tty falg is provided 2022-05-13 16:49:30 -05:00
sophia
7a999d1f06 Add tty flag and set noninteractive terminal 2022-05-13 13:46:36 -05:00
Paul Hinze
73a1be95fe
Fix nil dereference bug in new error handling logic
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.
2022-04-25 12:26:49 -05:00
Paul Hinze
1341bfe0af
Tweak Ruby->Go error handling so exit codes match
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!
2022-04-25 12:26:49 -05:00
Paul Hinze
7f56168959
Work around a few global flag collisions for ssh command
* `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
2022-04-25 12:26:48 -05:00
sophia
f97aff623f
Set default log level fwhen launching vagrant ruby 2022-04-25 12:26:45 -05:00
sophia
3516aa7131
Set defailt Vagrant log level 2022-04-25 12:26:44 -05:00
sophia
0904996af1
Set default log level for VAGRANT_LOG 2022-04-25 12:26:44 -05:00
Paul Hinze
736e080add
Fix version printing to pass vagrant-spec
* 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
2022-04-25 12:26:41 -05:00
Chris Roberts
14fa44a449
Update to use command info from sdk 2022-04-25 12:26:32 -05:00
Chris Roberts
46a9440b57
Set remaining args into proto 2022-04-25 12:26:26 -05:00
Chris Roberts
c010ae0429
Update CLI to use internal flags implementation 2022-04-25 12:26:25 -05:00
Chris Roberts
16931138e7
Update git submodule location
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.
2022-04-25 12:26:25 -05:00
Chris Roberts
d8145cdd52
Update flag value extraction for dynamic commands 2022-04-25 12:26:22 -05:00
Chris Roberts
e00f82fdee
Update to use component flags and update parsing 2022-04-25 12:26:22 -05:00
Chris Roberts
39439cf9fb
Register commands and subcommands during setup 2022-04-25 12:26:22 -05:00
Chris Roberts
66dc2fd259
Remove loading status during startup 2022-04-25 12:26:22 -05:00
Chris Roberts
5115bc3fb3
Update to use component command flags 2022-04-25 12:26:21 -05:00
sophia
deb667ecd3
Use common rpc errdetails messages 2022-04-25 12:26:20 -05:00
sophia
219473fb60
Seach for localized error message in error details 2022-04-25 12:26:20 -05:00
sophia
c4e97bb89b
Send localized message originating from plugin (if applicable) 2022-04-25 12:26:20 -05:00
Chris Roberts
42a89335d4
Set environment variable to persist logging level 2022-04-25 12:26:19 -05:00
sophia
bb43048813
Remove unused cli config code 2022-04-25 12:26:06 -05:00
Chris Roberts
96ac78a9a4
Fix some panics 2022-04-25 12:24:31 -05:00
Chris Roberts
6bc65c10c8
Update dynamic to use client directly and automatically set scope 2022-04-25 12:24:25 -05:00
Chris Roberts
9caa92a20a
Update command setup to use base client and then load scope
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.
2022-04-25 12:24:25 -05:00
Chris Roberts
dd9f7f19b4
Update types used 2022-04-25 12:24:24 -05:00
Chris Roberts
cd222f4622
Clean loading UI usage. Add an extra logging flag.
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.
2022-04-25 12:24:24 -05:00
Chris Roberts
b86e9c3e8b
Temporarily disable local check in client UI setup 2022-04-25 12:24:24 -05:00
Chris Roberts
4e28d59806
Temporary updates to force project loading 2022-04-25 12:24:23 -05:00
Chris Roberts
29c3cf439b
Support passing exit code back to origin 2022-04-25 12:24:11 -05:00
Chris Roberts
b2cf6ed9bf
Use new mapper function name 2022-04-25 12:24:11 -05:00
Chris Roberts
05d5634c83
Host component related work 2022-04-25 12:24:10 -05:00
Chris Roberts
26dbb5bda3
Update naming in log output from machine to target 2022-04-25 12:24:07 -05:00
Chris Roberts
c547fba079
Remove machine from cli and reference only targets 2022-04-25 12:24:06 -05:00
sophia
3107da72af
Execute subcommands 2022-04-25 12:24:02 -05:00
sophia
c3ee750db1
Add gogo 2022-04-25 12:23:57 -05:00