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:
Giorgio Gallo
2023-05-04 11:06:56 +10:00
committed by GitHub
parent bbe3055006
commit 80b42b81fd
8 changed files with 438 additions and 3 deletions
+4 -1
View File
@@ -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)
}
}