-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1033 from wader/toml-yaml-indent
yaml,toml: Add indent option for to_{toml,yaml}
- Loading branch information
Showing
7 changed files
with
114 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
$ fq -rn "{a: {b: 123}} | to_toml" | ||
[a] | ||
b = 123 | ||
|
||
$ fq -rn "{a: {b: 123}} | to_toml({indent: range(8)})" | ||
[a] | ||
b = 123 | ||
|
||
[a] | ||
b = 123 | ||
|
||
[a] | ||
b = 123 | ||
|
||
[a] | ||
b = 123 | ||
|
||
[a] | ||
b = 123 | ||
|
||
[a] | ||
b = 123 | ||
|
||
[a] | ||
b = 123 | ||
|
||
[a] | ||
b = 123 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
def _toml__todisplay: tovalue; | ||
def to_toml($opts): _to_toml($opts); | ||
def to_toml: _to_toml(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
$ fq -rn "{a: {b: 123}} | to_yaml" | ||
a: | ||
b: 123 | ||
|
||
$ fq -rn "{a: {b: 123}} | to_yaml({indent: range(8)})" | ||
a: | ||
b: 123 | ||
|
||
a: | ||
b: 123 | ||
|
||
a: | ||
b: 123 | ||
|
||
a: | ||
b: 123 | ||
|
||
a: | ||
b: 123 | ||
|
||
a: | ||
b: 123 | ||
|
||
a: | ||
b: 123 | ||
|
||
a: | ||
b: 123 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
def _yaml__todisplay: tovalue; | ||
def to_yaml($opts): _to_yaml($opts); | ||
def to_yaml: _to_yaml(null); |