https://pantsbuild.org/ logo
#general
Title
# general
h

happy-kitchen-89482

07/13/2020, 6:38 PM
Alternatively we can create yet another help command (
help-json
or something) which seems very extra. We already have a lot going on.
h

hundreds-breakfast-49010

07/13/2020, 6:40 PM
this seems like it should be an option to
help
rather than a new top-level command
👍 1
h

happy-kitchen-89482

07/13/2020, 6:41 PM
help
is special though, it's not a goal, and its options are special-cased
👍 1
You can do
--help-all
as well
h

hundreds-father-404

07/13/2020, 6:42 PM
Hm, it would indeed be nice if you could run
./pants help pytest --json
. Ik it’s hard to implement, but if we were to start from scratch, I’d want that feature.
h

happy-kitchen-89482

07/13/2020, 6:42 PM
We try to understand every possible request for help (
help
,
-h
,
--help
etc)
That seems overspecified. We might as well just dump out one big JSON blob and let you pick out the bits you need.
The structure of the big JSON blob and the little one would have to be the same anyway.
👍 1
The little one would just have less data in it, but you'd still have to know how to drill down into it.
So at that point, is there value in dumping partial data?
h

hundreds-father-404

07/13/2020, 6:44 PM
That’s fair
h

happy-kitchen-89482

07/13/2020, 6:44 PM
Basically the way it works today is we strip out any help commands/flags from the args, and special-case them
adding
--json
to that list seems risky
It means no goal can have a
--json
flag
👍 2
h

hundreds-father-404

07/13/2020, 6:46 PM
Okay, that’s a non-starter
Yeah, sounds good for
help-all
to output JSON. I think we should mention JQ in the docs, though, as some devs might not be familiar with it and aren’t used to a CLI tool outputting an enormous blob of JSON meant to be consumed by humans
👍 1
h

happy-kitchen-89482

07/13/2020, 6:48 PM
Sure
h

hundreds-breakfast-49010

07/13/2020, 6:54 PM
jq's a great tool and informing more people about it is a public good
💯 1
3 Views