mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-07 02:48:27 +08:00
Implement shell output format (#1645)
* fix typo in a comment * implement shell output format * fix a typo * add two test cases, have source uses ascii only * add integration tests and documentation * add fixes after code revieew
This commit is contained in:
@@ -32,6 +32,7 @@ const (
|
||||
UriOutputFormat
|
||||
ShOutputFormat
|
||||
TomlOutputFormat
|
||||
ShellVariablesOutputFormat
|
||||
)
|
||||
|
||||
func OutputFormatFromString(format string) (PrinterOutputFormat, error) {
|
||||
@@ -50,8 +51,10 @@ func OutputFormatFromString(format string) (PrinterOutputFormat, error) {
|
||||
return XMLOutputFormat, nil
|
||||
case "toml":
|
||||
return TomlOutputFormat, nil
|
||||
case "shell", "s", "sh":
|
||||
return ShellVariablesOutputFormat, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("unknown format '%v' please use [yaml|json|props|csv|tsv|xml]", format)
|
||||
return 0, fmt.Errorf("unknown format '%v' please use [yaml|json|props|csv|tsv|xml|toml|shell]", format)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user