janet-lang / jpm

Janet Project Manager
MIT License
65 stars 21 forks source link

Add tasks subcommand #67

Closed sogaiu closed 1 year ago

sogaiu commented 1 year ago

This PR adds a tasks subcommand so that only rules that are tasks can be listed.

An example where this makes a difference can be seen by trying it in andrewchambers' janet-where-defined.

With jpm rules, I get:

$ jpm rules
/home/user/.local/lib/janet/.manifests/where-defined.jdn
build
build/_jmod_where_defined.a
build/_jmod_where_defined.meta.janet
build/_jmod_where_defined.so
build/where-defined.o
build/where-defined.static.o
clean
install
libbacktrace/.libs/libbacktrace.a
manifest
test
uninstall

With jpm tasks, I get:

$ jpm tasks
build
clean
install
manifest
test
uninstall

This can also be handy when putting together shell completion functionality as jpm can be queried for a list of rules that are tasks.