Add input flag aliases and improve docs #63
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds input flags
-Jto alias--input=jsonand-Tto alias--input=toml.These do not clash with jq's cli flags.
Rationale and Caveats
A potentially scary thing about this approach is that we could not do this for any new format. E.g. if we added RON support, we would not be able to add -R shorthand for ron input because
jqhas a-Rflag.Thinking that these (less primary, potential future formats) will just have to deal with the explicit --input=ron style.
We could of course do the coreutils binary style thing, but the short xq style binary names are already very much taken. Soo, that would leave us with
lqt/lqy/lqjetc for input, orlqyy/lqjt, orlq y,lq j,lq jt. Not nice.In the end, going for this micro-optimisation because i write tools for myself that i want to be nice/convenient to use now, rather than idealistic for a future that probably never comes.