Comments (4)
Hi @nitrocode, thank you for reporting!
The type of last 2 is block rather than attribute. So I expect to get it with hcledit block get
.
I tested and confirmed that the top level block seems to be ok, but the nested doesn't.
$ cat test.tf | hcledit block get resource.foo.bar.nested
$ cat test.tf | hcledit block get resource.foo.bar
resource "foo" "bar" {
attr1 = "val1"
nested {
attr2 = "val2"
}
}
I agree it's natural to expect returning the nested block as the same as the nested attribute. We should support it.
Strictly speaking, the hcledit block get
returns not only block body { ... }
, but also block header resource "foo" "bar"
. Do you want to get the block body without the header? if so, we need to support hcledit body get
.
from hcledit.
@nitrocode The hcledit block get
command now returns not only the top-level block, but also the nested block. See #22
from hcledit.
@nitrocode I added hcledit body get
command in #23.
The expected behavior you described above contains the outer braces {}
, however, according to the HCL spec, the outer braces don't belong to the body.
https://github.com/hashicorp/hcl/blob/v2.9.1/hclsyntax/spec.md#structural-elements
So, I intentionally didn't include them in the outputs.
from hcledit.
Yes I agree with you. I didn't realize there was a block get command.
As you already mentioned, ybese changes would be nice
- Support
body get
to retrieve body without header - Support
block get
for blocks
from hcledit.
Related Issues (20)
- How to edit an attribute? HOT 2
- Add exit codes to get commands
- unable to handle multiple provider configurations HOT 1
- Edit/fetch item in a list HOT 1
- hcledit always formats the output HOT 1
- Cannot append nested block
- FR: add 'raw' flag for attribute get
- We would like to edit subblocks, which basically is a block in an attribute value HOT 2
- Support updating without knowing the file
- [Question] - How to pass and parse input to command HOT 1
- Nested Objects in Variables HOT 2
- Publish windows artifact HOT 7
- Don't output comma at the end of lists HOT 1
- Support attribute list
- Does not support `dev_overrides` HOT 2
- Add support for changing the order of attributes/blocks HOT 1
- Can this be used as jo for HCL? HOT 9
- Inline comment in child block does not show up in `body get`
- `dynamic` block support HOT 3
- nested values in a module doesn't work HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hcledit.