Is there a way to get `./pants list` to output onl...
# general
l
Is there a way to get
./pants list
to output only filenames and not the owning target name as well?
f
not sure if that's what you want?
Copy code
❯ ./pants list helloworld:: | xargs ./pants filedeps 
helloworld/BUILD
helloworld/__init__.py
helloworld/greet/BUILD
helloworld/greet/__init__.py
helloworld/greet/greeting.py
helloworld/greet/greeting_test.py
helloworld/greet/translations.json
helloworld/main.py
helloworld/translator/BUILD
helloworld/translator/__init__.py
helloworld/translator/translator.py
helloworld/translator/translator_test.py
On https://github.com/pantsbuild/example-python
Copy code
❯ ./pants filedeps helloworld/translator:
helloworld/translator/BUILD
helloworld/translator/__init__.py
helloworld/translator/translator.py
helloworld/translator/translator_test.py
l
filedeps is helpful, I am just trying to avoid having do do this all the time:
./pants list .... | cut -d: -f1
f
I get it. We ended up writing a simple plugin with a new goal just for this 🙂
c
using
./pants peek | jq ...
but that’s hardly easier than piping through
cut
..
1
f
well at least JSON, perhaps a tad more readable
c
.. oh, I meant to use a jq query to just output the filenames..
Copy code
╰─❯ ./pants peek src/python/pants/backend/docker:: | jq -r '.[]|.sources[]'
src/python/pants/backend/docker/__init__.py
src/python/pants/backend/docker/package_types.py
src/python/pants/backend/docker/register.py
src/python/pants/backend/docker/registries.py
...
1