aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-02-01 12:02:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-02-01 12:02:31 +0200
commitf1276d87c00e1b7736211c45bf63766142643383 (patch)
treed273c39963b3a3636520b38de42dfa903729f486
parent4b7613b5bac8d54d369132cfaaefcc755310c207 (diff)
Pass actual argv[0] to build2::init()
-rw-r--r--bpkg/bpkg.cxx17
1 files 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<size_t>::max () / 2);
//
template <typename O>
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<help_options> (co,
+ return help (init<help_options> (argv[0],
+ co,
scan,
argsv, scanv,
"help",
@@ -523,7 +525,8 @@ try
if (h)
{
- ho = init<help_options> (co,
+ ho = init<help_options> (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<pkg_verify_options> (co,
+ // r = pkg_verify (init<pkg_verify_options> (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<NP##CMD##_options> (co, \
+ r = NP##CMD (init<NP##CMD##_options> (argv[0], \
+ co, \
scan, \
argsv, \
scanv, \