omniosorg / pkg5

Image Packaging System
https://omnios.org/
Other
12 stars 56 forks source link

"pkg contents" could use a new exit status for "no matching actions found" #454

Open jclulow opened 1 year ago

jclulow commented 1 year ago

Right now, if you list the contents of a package or set of packages with a filter, and that filter does not match any actions that exist within the package, pkg contents fails with a generic exit status:

$ pkg contents -t depend -a type=optional -H -o fmri SUNWcs
pkg: contents: no matching actions found in the listed packages
$ echo  $?
1

It seems useful to be able to distinguish the "no matching actions found in the listed packages" case from other errors without parsing the human-readable error message.

It might even make sense to add a new flag (perhaps -q) to just squelch this error altogether and exit 0 in this case.