Commit Graph

14 Commits

Author SHA1 Message Date
Alisdair McDiarmid 163c943e9b command: Fix bug with -v/-version/--version flags
We globally support a -v/-version/--version flag, which triggers the
version subcommand. The recent introduction of JSON output support meant
we started parsing the flags for the first time, but we didn't add flags
for these global version arguments.

This commit adds those flags (but doesn't check them, since they have no
effect on the version command itself). Also adds usage information for
terraform version.
2020-06-17 15:24:15 -04:00
Katy Moe d8e22f1804 add terraform version -json 2020-06-16 14:47:57 -04:00
Martin Atkins 549aede792 Remove terraform.ResourceProvider, use providercache.Installer instead
Back when we first introduced provider versioning in Terraform 0.10, we
did the provider version resolution in terraform.NewContext because we
weren't sure yet how exactly our versioning model was going to play out
(whether different versions could be selected per provider configuration,
for example) and because we were building around the limitations of our
existing filesystem-based plugin discovery model.

However, the new installer codepath is new able to do all of the
selections up front during installation, so we don't need such a heavy
inversion of control abstraction to get this done: the command package can
select the exact provider versions and pass their factories directly
to terraform.NewContext as a simple static map.

The result of this commit is that CLI commands other than "init" are now
able to consume the local cache directory and selections produced by the
installation process in "terraform init", passing all of the selected
providers down to the terraform.NewContext function for use in
implementing the main operations.

This commit is just enough to get the providers passing into the
terraform.Context. There's still plenty more to do here, including to
repair all of the tests this change has additionally broken.
2020-04-06 09:24:23 -07:00
Alisdair McDiarmid 67203dade8 command: Simplify Meta.process helper method
After some refactoring, this helper method had an unused argument (vars)
and an always-nil error return value. This commit cleans this up.
2020-04-01 15:01:08 -04:00
Ethan 6833ac290b command: Use full URL for the download page when prompting for upgrade
This makes it more likely that a terminal emulator will detect the URL as a clickable link.
2019-11-08 16:10:39 -08:00
Antoine Jacoutot 37a6331ebf command/version: drop empty line on version check (#14858)
We always add an empty line when asking/checking the version. We should only do
that if there is a new version available. While this is purely cosmetic, it
reads better and is consistent with packer.
2019-07-06 15:18:13 +02:00
Martin Atkins 5347f82f9a command: Include provider versions in "terraform version"
We encourage users to share the "terraform version" output as part of
filing an issue, but previously it only printed the core Terraform version
and this left provider maintainers with no information about which
_provider_ version an issue relates to.

Here we make a best effort to show versions for providers, though we will
omit some or all of them if either "terraform init" hasn't been run (and
so no providers were selected yet) or if there are other inconsistencies
that would cause Terraform to object on startup and require a re-run of
"terraform init".
2017-10-25 17:36:24 -07:00
Jearvon Dharrie 5afe1d39d1 Add `/downloads` to the outdated version message 2017-09-15 12:58:40 -07:00
Robert Liebowitz 006744bfe0 Use all tfvars files in working directory
As a side effect, several commands that previously did not have a failure
state can now fail during meta-parameter processing.
2017-07-05 17:24:17 -07:00
lalyos 92540d3d88 fixing version numbers RCs should be labeled x.x.x-rcx
see conversation with ryanuber: https://github.com/hashicorp/go-checkpoint/issues/2#issuecomment-73199209
2015-02-07 16:56:56 +01:00
Mitchell Hashimoto 70191d22a6 Add checkpoint 2014-10-13 14:05:43 -07:00
Mitchell Hashimoto 642fed0356 command: terraform.tfvars loaded by default if it exists 2014-08-05 09:32:01 -07:00
Mitchell Hashimoto dde0f0f8df command/version: use Meta 2014-07-13 10:42:18 -07:00
Mitchell Hashimoto a4a4e3784d Implement CLI, version command 2014-05-24 12:04:43 -07:00