News for hackers. Stuff that matters.
Re:jc: Converts the output of popular command-line tools to ... by pushedx on Friday December 08, 2023 @09:40AM (#38569571)
I salute whoever chooses to maintain this
Re:jc: Converts the output of popular command-line tools to ... by amelius on Friday December 08, 2023 @11:22AM (#38570755)
I salute whoever chooses to use this and runs into the assumptions made by this tool that turn out to be wrong.
Re:jc: Converts the output of popular command-line tools to ... by CoastalCoder on Friday December 08, 2023 @09:59AM (#38569805)
Good point. This reminds me of the Linux (Unix?) "file" program, and whichever hero(es) maintain it.
Re:jc: Converts the output of popular command-line tools to ... by alex_suzuki on Friday December 08, 2023 @09:49AM (#38569685)
I wonder how they will address versions…

`aws s3 ls | jc —-aws=1.2.3`

What a nightmare.

Re:jc: Converts the output of popular command-line tools to ... by dtech on Friday December 08, 2023 @10:11AM (#38569949)
Aws cli isn't the best example because it supports outputting json natively.

I'd expect this to not be a huge problem in practice because this is mostly for those well established unix cli tools of which the output has mostly ossified anyway. Many modern and frequently updated tools support native JSON output.

Re:jc: Converts the output of popular command-line tools to ... by hnlmorg on Friday December 08, 2023 @10:54AM (#38570458)
> Aws cli isn't the best example because it supports outputting json natively.

The s3 sub command annoyingly doesn’t. Which I’m guessing is the reason the GP used that specifically.

Re:jc: Converts the output of popular command-line tools to ... by cwilkes on Friday December 08, 2023 @11:53AM (#38571125)
Re:jc: Converts the output of popular command-line tools to ... by hnlmorg on Friday December 08, 2023 @12:02PM (#38571251)
You can, but it’s not nearly as nice to use. For starters you have to manage pagination yourself.
Re:jc: Converts the output of popular command-line tools to ... by dj_mc_merlin on Friday December 08, 2023 @09:54AM (#38569754)
What about

jc 'aws sts get-caller-identity' | jq [..]

That way the aws process can be a subprocess of jc, which can read where the binary is and get its version automatically.

Re:jc: Converts the output of popular command-line tools to ... by sesm on Friday December 08, 2023 @12:16PM (#38571445)
jc already has this, see ‘jc dig example.com’ in examples. They call it ‘alternative magic syntax’, but IMO it should be the primary syntax, while piping and second-guessing the previous commands parameters and version should be used only in exceptional cases.
Re:jc: Converts the output of popular command-line tools to ... by jasonjayr on Friday December 08, 2023 @10:40AM (#38570314)
That can get thorny, because it adds another level of shell-quoting/escapes, and that is a notorious vector for security problems.
Re:jc: Converts the output of popular command-line tools to ... by sesm on Friday December 08, 2023 @05:19PM (#38575395)
In theory, if it could load something like ‘plugins’ (for example as separate shell commands) some of the maintenance effort could be offloaded to ‘plugin’ authors.
Re:jc: Converts the output of popular command-line tools to ... by kbrazil on Friday December 08, 2023 @06:58PM (#38576608)