diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-10-22 11:07:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-10-22 11:07:03 +0200 |
commit | e6f10cabb7fbdba6fd11bcd109dbe765285c762c (patch) | |
tree | 350e0bf1230e930d2c9512eab396a80ffc98b610 /bpkg/bpkg.cxx | |
parent | 56af938cd423c1b6730d753ba1ce7b70cd660c29 (diff) |
Implement dependents check in drop command
Also, add support for commands to return program status.
Diffstat (limited to 'bpkg/bpkg.cxx')
-rw-r--r-- | bpkg/bpkg.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx index 61f7425..6246d6f 100644 --- a/bpkg/bpkg.cxx +++ b/bpkg/bpkg.cxx @@ -145,6 +145,7 @@ try // Handle commands. // + int r (1); for (;;) { // help @@ -152,7 +153,7 @@ try if (cmd.help ()) { assert (h); - help (ho, "help", help_options::print_usage); + r = help (ho, "help", help_options::print_usage); break; } @@ -163,7 +164,7 @@ try // if (h) // help (ho, "pkg-verify", pkg_verify_options::print_usage); // else - // pkg_verify (parse<pkg_verify_options> (co, args), args); + // r = pkg_verify (parse<pkg_verify_options> (co, args), args); // // return 0; // } @@ -174,7 +175,7 @@ try if (h) \ help (ho, SP#CMD, NP##CMD##_options::print_usage); \ else \ - NP##CMD (parse<NP##CMD##_options> (co, args), args); \ + r = NP##CMD (parse<NP##CMD##_options> (co, args), args); \ \ break; \ } @@ -219,6 +220,9 @@ try fail << "unhandled command"; } + if (r != 0) + return r; + // Warn if args contain some leftover junk. We already successfully // performed the command so failing would probably be misleading. // |