New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terraform command completions #3960

Merged
merged 7 commits into from Apr 17, 2017

Conversation

Projects
None yet
3 participants
@adambyrtek
Contributor

adambyrtek commented Apr 16, 2017

Description

Terraform is an open source declarative infrastructure management tool:
https://www.terraform.io
https://github.com/hashicorp/terraform

This PR adds completions for all basic commands and their flags:

$ terraform help
Usage: terraform [--version] [--help] <command> [args]

The available commands for execution are listed below.
The most common, useful commands are shown first, followed by
less common or more advanced commands. If you're just getting
started with Terraform, stick with the common commands. For the
other commands, please read the help and docs before usage.

Common commands:
    apply              Builds or changes infrastructure
    console            Interactive console for Terraform interpolations
    destroy            Destroy Terraform-managed infrastructure
    env                Environment management
    fmt                Rewrites config files to canonical format
    get                Download and install modules for the configuration
    graph              Create a visual graph of Terraform resources
    import             Import existing infrastructure into Terraform
    init               Initialize a new or existing Terraform configuration
    output             Read an output from a state file
    plan               Generate and show an execution plan
    push               Upload this Terraform module to Atlas to run
    refresh            Update local state file against real resources
    show               Inspect Terraform state or plan
    taint              Manually mark a resource for recreation
    untaint            Manually unmark a resource as tainted
    validate           Validates the Terraform files
    version            Prints the Terraform version

The code was based on Git completions in order to keep things consistent.

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages (N/A)
  • Tests have been added for regressions fixed (N/A)
  • User-visible changes noted in CHANGELOG.md
@adambyrtek

This comment has been minimized.

Show comment
Hide comment
@adambyrtek

adambyrtek Apr 17, 2017

Contributor

@krader1961 Thanks for a quick turnaround and helpful comments! Please take another look. By the way, looks like the Git completion I based this one on needs the same changes. I might look into that later today.

Contributor

adambyrtek commented Apr 17, 2017

@krader1961 Thanks for a quick turnaround and helpful comments! Please take another look. By the way, looks like the Git completion I based this one on needs the same changes. I might look into that later today.

Show outdated Hide outdated CHANGELOG.md
@adambyrtek

This comment has been minimized.

Show comment
Hide comment
@adambyrtek

adambyrtek Apr 17, 2017

Contributor

@faho I've made the changes you requested.

Contributor

adambyrtek commented Apr 17, 2017

@faho I've made the changes you requested.

@faho faho merged commit e7d6864 into fish-shell:master Apr 17, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@faho

This comment has been minimized.

Show comment
Hide comment
@faho

faho Apr 17, 2017

Member

Merged, thanks!

Member

faho commented Apr 17, 2017

Merged, thanks!

@faho faho added the completions label Apr 17, 2017

@faho faho added this to the 2.6.0 milestone Apr 17, 2017

@adambyrtek adambyrtek deleted the adambyrtek:terraform-completion branch Apr 17, 2017

@adambyrtek

This comment has been minimized.

Show comment
Hide comment
@adambyrtek

adambyrtek Apr 17, 2017

Contributor

@faho You're welcome, it's a pleasure with maintainers being so helpful and responsive :)

Contributor

adambyrtek commented Apr 17, 2017

@faho You're welcome, it's a pleasure with maintainers being so helpful and responsive :)

develop7 added a commit to develop7/fish-shell that referenced this pull request Apr 17, 2017

Terraform completions (#3960)
* Basic Terraform completion supporting all commands

* Option completion for Terraform commands

* Search command line in reverse order

* CHANGELOG entry

* Fix `terraform untaint` completion

* Use common completion functions to handle subcommands

* Use imperative form and remove CHANGELOG changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment