diff --git a/pkg/interp/args.jq b/pkg/interp/args.jq index 8710c7b5..35cfbef2 100644 --- a/pkg/interp/args.jq +++ b/pkg/interp/args.jq @@ -70,8 +70,12 @@ def args_parse($args; $opts): ( $opts | to_entries | map( - ( ({(.value.short): .key}? // {}) - + ({(.value.long): .key}? // {}) + ( . as $opt + | [.value.short // empty] + + [.value.long // empty] + + (.value.aliases // []) + | map({key: ., value: $opt.key}) + | from_entries ) ) | add diff --git a/pkg/interp/interp.jq b/pkg/interp/interp.jq index 06bd8a7f..3124e9a9 100644 --- a/pkg/interp/interp.jq +++ b/pkg/interp/interp.jq @@ -503,6 +503,8 @@ def _main: "null_output": { short: "-0", long: "--null-output", + # for jq compatibility + aliases: ["--nul-output"], description: "Null byte between outputs", bool: true }, diff --git a/pkg/interp/testdata/output.fqtest b/pkg/interp/testdata/output.fqtest index 55c04bb1..f54e820f 100644 Binary files a/pkg/interp/testdata/output.fqtest and b/pkg/interp/testdata/output.fqtest differ