mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-02 23:34:48 +08:00
Add support for Lua input (#1810)
This commit is contained in:
@@ -1,5 +1,33 @@
|
||||
|
||||
## Basic example
|
||||
## Basic input example
|
||||
Given a sample.lua file of:
|
||||
```lua
|
||||
return {
|
||||
["country"] = "Australia"; -- this place
|
||||
["cities"] = {
|
||||
"Sydney",
|
||||
"Melbourne",
|
||||
"Brisbane",
|
||||
"Perth",
|
||||
};
|
||||
};
|
||||
|
||||
```
|
||||
then
|
||||
```bash
|
||||
yq -oy '.' sample.lua
|
||||
```
|
||||
will output
|
||||
```yaml
|
||||
country: Australia
|
||||
cities:
|
||||
- Sydney
|
||||
- Melbourne
|
||||
- Brisbane
|
||||
- Perth
|
||||
```
|
||||
|
||||
## Basic output example
|
||||
Given a sample.yml file of:
|
||||
```yaml
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user