From c75a83c829be93baacdaf371017aac1055dcd19a Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Sat, 4 Mar 2023 09:53:33 +0100 Subject: [PATCH] help: Show default option value as JSON --- format/csv/testdata/help_csv.fqtest | 4 ++-- format/xml/testdata/help_html.fqtest | 6 +++--- format/xml/testdata/help_xml.fqtest | 6 +++--- pkg/interp/help.jq | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/format/csv/testdata/help_csv.fqtest b/format/csv/testdata/help_csv.fqtest index 6c4a6c9b..3863d12a 100644 --- a/format/csv/testdata/help_csv.fqtest +++ b/format/csv/testdata/help_csv.fqtest @@ -4,8 +4,8 @@ csv: Comma separated values decoder Options ======= - comma=, Separator character - comment=# Comment line character + comma="," Separator character + comment="#" Comment line character Decode examples =============== diff --git a/format/xml/testdata/help_html.fqtest b/format/xml/testdata/help_html.fqtest index f3147118..ec644e2a 100644 --- a/format/xml/testdata/help_html.fqtest +++ b/format/xml/testdata/help_html.fqtest @@ -4,9 +4,9 @@ html: HyperText Markup Language decoder Options ======= - array=false Decode as nested arrays - attribute_prefix=@ Prefix for attribute keys - seq=false Use seq attribute to preserve element order + array=false Decode as nested arrays + attribute_prefix="@" Prefix for attribute keys + seq=false Use seq attribute to preserve element order Decode examples =============== diff --git a/format/xml/testdata/help_xml.fqtest b/format/xml/testdata/help_xml.fqtest index 8fd3e639..c7e63867 100644 --- a/format/xml/testdata/help_xml.fqtest +++ b/format/xml/testdata/help_xml.fqtest @@ -4,9 +4,9 @@ xml: Extensible Markup Language decoder Options ======= - array=false Decode as nested arrays - attribute_prefix=@ Prefix for attribute keys - seq=false Use seq attribute to preserve element order + array=false Decode as nested arrays + attribute_prefix="@" Prefix for attribute keys + seq=false Use seq attribute to preserve element order Decode examples =============== diff --git a/pkg/interp/help.jq b/pkg/interp/help.jq index 5fd7212f..e8855b87 100644 --- a/pkg/interp/help.jq +++ b/pkg/interp/help.jq @@ -144,7 +144,7 @@ def _help($arg0; $topic): , if $f.decode_in_arg then ( $f.decode_in_arg | to_entries - | map([" \(.key)=\(.value) ", $f.decode_in_arg_doc[.key]]) + | map([" \(.key)=\(.value | tojson) ", $f.decode_in_arg_doc[.key]]) | "Options" , "=======" , ""