From f1276d87c00e1b7736211c45bf63766142643383 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 1 Feb 2022 12:02:31 +0200 Subject: Pass actual argv[0] to build2::init() --- bpkg/bpkg.cxx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx index c674a44..e9cb1d0 100644 --- a/bpkg/bpkg.cxx +++ b/bpkg/bpkg.cxx @@ -201,7 +201,8 @@ static const size_t args_pos (numeric_limits::max () / 2); // template static O -init (const common_options& co, +init (const char* argv0, + const common_options& co, cli::group_scanner& scan, strings& args, cli::vector_scanner& args_scan, const char* cmd, @@ -392,7 +393,7 @@ init (const common_options& co, // @@ TMP: pass proper values instead of dummies. // build2::init_diag (1); - build2::init (nullptr, "bpkg" /*argv[0]*/); + build2::init (nullptr, argv0); build2::bin::build2_bin_load (); build2::cc::build2_cc_load (); @@ -490,7 +491,8 @@ try const common_options& co (o); if (o.help ()) - return help (init (co, + return help (init (argv[0], + co, scan, argsv, scanv, "help", @@ -523,7 +525,8 @@ try if (h) { - ho = init (co, + ho = init (argv[0], + co, scan, argsv, scanv, "help", @@ -571,7 +574,8 @@ try // if (h) // r = help (ho, "pkg-verify", print_bpkg_pkg_verify_usage); // else - // r = pkg_verify (init (co, + // r = pkg_verify (init (argv[0], + // co, // scan, // argsv, // scanv, @@ -589,7 +593,8 @@ try if (h) \ r = help (ho, SP#CMD, print_bpkg_##NP##CMD##_usage); \ else \ - r = NP##CMD (init (co, \ + r = NP##CMD (init (argv[0], \ + co, \ scan, \ argsv, \ scanv, \ -- cgit v1.1