aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-02-02 12:16:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-02-02 12:16:54 +0200
commitcb1225403365fd8b00d1f79e2bc4249e55fb36a0 (patch)
tree5e5c257405be3cc012f77dd26caab3f67db7d89c
parentd956e69e8b55dc2248b902490a138a46f02f9e55 (diff)
Complete and normalize --default-options path
-rw-r--r--bpkg/bpkg.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx
index 76b2533..28ba75f 100644
--- a/bpkg/bpkg.cxx
+++ b/bpkg/bpkg.cxx
@@ -446,8 +446,25 @@ init (const common_options& co,
{
optional<dir_path> extra;
if (o.default_options_specified ())
+ {
extra = o.default_options ();
+ // Note that load_default_options() expects absolute and normalized
+ // directory.
+ //
+ try
+ {
+ if (extra->relative ())
+ extra->complete ();
+
+ extra->normalize ();
+ }
+ catch (const invalid_path& e)
+ {
+ fail << "invalid --default-options value " << e.path;
+ }
+ }
+
default_options<O> dos (
load_default_options<O, cli::argv_file_scanner, cli::unknown_mode> (
nullopt /* sys_dir */,