Skip to content

Commit

Permalink
interp: Remove --options, probably just confusing
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Oct 17, 2021
1 parent 36fd74a commit d6d9484
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 54 deletions.
3 changes: 1 addition & 2 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ Usage: fq [OPTIONS] [--] [EXPR] [FILE...]
--monochrome-output,-M Force monochrome output
--null-input,-n Null input (use input/0 and inputs/0 to read input)
--null-output,-0 Null byte between outputs
--option,-o KEY=VALUE Set option, eg: color=true
--options Show all options
--option,-o KEY=VALUE Set option, eg: color=true (use options/0 to see all options)
--raw-input,-R Read raw input strings (don't decode)
--raw-output,-r Raw string output (without quotes)
--rawfile NAME PATH Set variable $NAME to string content of file
Expand Down
9 changes: 1 addition & 8 deletions pkg/interp/interp.jq
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,9 @@ def _main:
"option": {
short: "-o",
long: "--option",
description: "Set option, eg: color=true",
description: "Set option, eg: color=true (use options/0 to see all options)",
object: "KEY=VALUE",
},
"show_options": {
long: "--options",
description: "Show all options",
bool: true
},
"string_input": {
short: "-R",
long: "--raw-input",
Expand Down Expand Up @@ -452,8 +447,6 @@ def _main:
$version | println
elif $opts.show_formats then
_formats_list | println
elif $opts.show_options then
$opts | display
elif
( ($rest | length) == 0 and
($opts.repl | not) and
Expand Down
2 changes: 0 additions & 2 deletions pkg/interp/options.jq
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def _build_default_fixed_options:
sizebase: 10,
show_formats: false,
show_help: false,
show_options: false,
slurp: false,
string_input: false,
unicode: ($stdout.is_terminal and env.CLIUNICODE != null),
Expand Down Expand Up @@ -128,7 +127,6 @@ def _to_options:
sizebase: (.sizebase | _tonumber),
show_formats: (.show_formats | _toboolean),
show_help: (.show_help | _toboolean),
show_options: (.show_options | _toboolean),
slurp: (.slurp | _toboolean),
string_input: (.string_input | _toboolean),
unicode: (.unicode | _toboolean),
Expand Down
42 changes: 1 addition & 41 deletions pkg/interp/testdata/args.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ Usage: fq [OPTIONS] [--] [EXPR] [FILE...]
--monochrome-output,-M Force monochrome output
--null-input,-n Null input (use input/0 and inputs/0 to read input)
--null-output,-0 Null byte between outputs
--option,-o KEY=VALUE Set option, eg: color=true
--options Show all options
--option,-o KEY=VALUE Set option, eg: color=true (use options/0 to see all options)
--raw-input,-R Read raw input strings (don't decode)
--raw-output,-r Raw string output (without quotes)
--rawfile NAME PATH Set variable $NAME to string content of file
Expand Down Expand Up @@ -116,45 +115,6 @@ vpx_ccr VPX Codec Configuration Record
wav WAV file
webp WebP image
xing Xing header
$ fq --options
{
"addrbase": 16,
"arg": [],
"argjson": [],
"array_truncate": 50,
"bits_format": "snippet",
"byte_colors": "0-0xff=brightwhite,0=brightblack,32-126:9-13=white",
"color": false,
"colors": "array=white,dumpaddr=yellow,dumpheader=yellow+underline,error=brightred,false=yellow,index=white,null=brightblack,number=cyan,object=white,objectkey=brightblue,string=green,true=yellow,value=white",
"compact": false,
"decode_file": [],
"decode_format": "probe",
"decode_progress": false,
"depth": 0,
"display_bytes": 16,
"expr": ".",
"expr_eval_path": "arg",
"expr_file": null,
"filenames": [
"-"
],
"include_path": null,
"join_string": "\n",
"line_bytes": 16,
"null_input": false,
"raw_output": false,
"raw_string": false,
"rawfile": [],
"repl": false,
"show_formats": false,
"show_help": false,
"show_options": true,
"sizebase": 10,
"slurp": false,
"string_input": false,
"unicode": false,
"verbose": false
}
$ fq -X
exitcode: 2
stderr:
Expand Down
1 change: 0 additions & 1 deletion pkg/interp/testdata/options.fqtest
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ $ fq -n options
"repl": false,
"show_formats": false,
"show_help": false,
"show_options": false,
"sizebase": 10,
"slurp": false,
"string_input": false,
Expand Down

0 comments on commit d6d9484

Please sign in to comment.