As mentioned in the earlier RFC I've bounced around a bit on how best to do this. I settled on each command listing the switches it accepts, and having an OptionsFactory that knows what all the switches are and what sort of option it should create for each (flag, boolean or standard). This does of course assume Terraform is consistent with its switches but from what I've seen so far that appears to be the case (and saves having to incorporate the option specialisation into each command).
I have a follow up PR that updates all the commands to reflect the switches they accept in Terraform 0.15 but as this one was already pretty massive I thought I'd split it out at the point where the commands are still largely "the same" as they were before I started.
I've made some notes in the second commit about the small changes I had to make in the specs to make this work. Hopefully it all makes sense.
The last commit is just a minor fix to output and a change to the rubocop.yml to get a clean bill of health from rubocop :-)
As mentioned in the earlier RFC I've bounced around a bit on how best to do this. I settled on each command listing the switches it accepts, and having an OptionsFactory that knows what all the switches are and what sort of option it should create for each (flag, boolean or standard). This does of course assume Terraform is consistent with its switches but from what I've seen so far that appears to be the case (and saves having to incorporate the option specialisation into each command).
I have a follow up PR that updates all the commands to reflect the switches they accept in Terraform 0.15 but as this one was already pretty massive I thought I'd split it out at the point where the commands are still largely "the same" as they were before I started.
I've made some notes in the second commit about the small changes I had to make in the specs to make this work. Hopefully it all makes sense.
The last commit is just a minor fix to
output
and a change to therubocop.yml
to get a clean bill of health from rubocop :-)