diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-09-06 16:23:52 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-09-06 16:44:09 +0200 |
commit | f7a31c6a617c043171df737d4246c50c1f7286f3 (patch) | |
tree | 332f67853ab27bc960a620c9727d293f6c754520 /bpkg/pkg-status.cxx | |
parent | c5019d100308fd3e330678ec223d3891ed61d3c8 (diff) |
Add pkg-status --all|-a and --link options
Diffstat (limited to 'bpkg/pkg-status.cxx')
-rw-r--r-- | bpkg/pkg-status.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/bpkg/pkg-status.cxx b/bpkg/pkg-status.cxx index a376d38..2b05086 100644 --- a/bpkg/pkg-status.cxx +++ b/bpkg/pkg-status.cxx @@ -338,14 +338,19 @@ namespace bpkg } else { - // Find all held packages in this and all the dependency - // configurations. + // Find held/all packages in this and, if --link specified, all the + // dependency configurations. // + query q; + + if (!o.all ()) + q = query::hold_package; + for (database& ldb: db.dependency_configs ()) { for (shared_ptr<selected_package> s: pointer_result ( - ldb.query<selected_package> (query::hold_package))) + ldb.query<selected_package> (q))) { pkgs.push_back (package {ldb, s->hold_package ? ldb : db, @@ -354,11 +359,19 @@ namespace bpkg move (s), nullopt /* constraint */}); } + + if (!o.link ()) + break; } if (pkgs.empty ()) { - info << "no held packages in the configuration"; + if (o.all ()) + info << "no packages in the configuration"; + else + info << "no held packages in the configuration" << + info << "use --all|-a to see status of all packages"; + return 0; } } |