zephyrproject-rtos/west

west list: add option to not list project and return != 0 if project is not active when project list is provided

aescolar opened this issue · 1 comments

west list, by default, lists only projects which are active in the local workspace.
But if one queries for one particular project, it always lists it, even if not active.
So for users who want to know if the project is present, and if so, get some of its parameters,
it would be nice if west list returned != 0 to the shell if one of the requested projects was missing, and would not list it in stdout, when some new command line switch is provided (say something like --only-active).

Today, it seems the way to achieve what is requested here would be to first do a west status for the projects and then a west list.

Today, it seems the way to achieve what is requested here

You could do something like this today:

if [ $(west list -f {cloned} "$PROJECT") = cloned ] ; then ... ; fi