Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix command line option -h #15

Closed
nichtich opened this issue Jul 17, 2019 · 3 comments · Fixed by #18
Closed

Fix command line option -h #15

nichtich opened this issue Jul 17, 2019 · 3 comments · Fixed by #18
Labels
kind:bug An existing feature isn't doing something correctly
Milestone

Comments

@nichtich
Copy link
Contributor

Calling oq -h prints the help screen of jq -h and hangs. Both oq --help and oq -h should emit the same output. In my opinion the output of jq -h minus the first three lines should be appended to the current output of oq --help.

@Blacksmoke16 Blacksmoke16 added kind:bug An existing feature isn't doing something correctly status:todo labels Jul 17, 2019
@Blacksmoke16
Copy link
Owner

Blacksmoke16 commented Jul 17, 2019

This was originally by design as I wanted to give a way to access the help of jq as well as oq. But simply combining them might be the better implementation.

@Blacksmoke16 Blacksmoke16 added this to the 0.2.0 milestone Jul 18, 2019
@Blacksmoke16
Copy link
Owner

Blacksmoke16 commented Jul 19, 2019

Usage: oq [--help] [oq-arguments] [jq-arguments] jq_filter [file [files...]]
    -h, --help                       Show this help message.
    -i FORMAT, --input FORMAT        Format of the input data. Supported formats: json, yaml.
    -o FORMAT, --output FORMAT       Format of the output data. Supported formats: json, yaml, xml.
    --indent NUMBER                  Use the given number of spaces for indentation (JSON/XML only).
    --xml-root ROOT                  Name of the root XML element if converting to XML.
    --no-prolog                      Whether the XML prolog should be emitted if converting to XML.

	jq is a tool for processing JSON inputs, applying the
	given filter to its JSON text inputs and producing the
	filter's results as JSON on standard output.
	The simplest filter is ., which is the identity filter,
	copying jq's input to its output unmodified (except for
	formatting).
	For more advanced filters see the jq(1) manpage ("man jq")
	and/or https://stedolan.github.io/jq

	Some of the options include:
	 -c		compact instead of pretty-printed output;
	 -n		use `null` as the single input value;
	 -e		set the exit status code based on the output;
	 -s		read (slurp) all inputs into an array; apply filter to it;
	 -r		output raw strings, not JSON texts;
	 -R		read raw strings, not JSON texts;
	 -C		colorize JSON;
	 -M		monochrome (don't colorize JSON);
	 -S		sort keys of objects on output;
	 --tab	use tabs for indentation;
	 --arg a v	set variable $a to value <v>;
	 --argjson a v	set variable $a to JSON value <v>;
	 --slurpfile a f	set variable $a to an array of JSON texts read from <f>;
	See the manpage for more options.

Is what I got ATM.

I'm happy with it.

@Blacksmoke16 Blacksmoke16 mentioned this issue Jul 19, 2019
3 tasks
@nichtich
Copy link
Contributor Author

Great! I'd only replace the tabs in jq's help with 4 spaces but that's cosmetics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug An existing feature isn't doing something correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants