aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-08-16 15:05:13 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-08-16 15:05:13 +0300
commitffdf220f64c7362bf06f8d43aa9820ed4634fdbb (patch)
tree55d4cca954a14f5248abeea08fbc8d8db3d01ac7
parent9ee8453f2056bbc2b1767324dec805bf80707a37 (diff)
Add --no-default-options common option
-rw-r--r--bdep/bdep.cxx3
-rw-r--r--bdep/common.cli5
-rw-r--r--tests/new.testscript8
3 files changed, 14 insertions, 2 deletions
diff --git a/bdep/bdep.cxx b/bdep/bdep.cxx
index 66431e9..7e6435f 100644
--- a/bdep/bdep.cxx
+++ b/bdep/bdep.cxx
@@ -212,10 +212,11 @@ init (const common_options& co,
: o.V () ? 3 : o.v () ? 2 : o.quiet () ? 0 : 1;
};
- // Handle default option files.
+ // Handle default options files.
//
// Note: don't need to use group_scaner (no arguments in options files).
//
+ if (!o.no_default_options ()) // Command line option.
try
{
o = merge_options (
diff --git a/bdep/common.cli b/bdep/common.cli
index d6d2273..c08d873 100644
--- a/bdep/common.cli
+++ b/bdep/common.cli
@@ -212,5 +212,10 @@ namespace bdep
the shell escaping and quoting is not required. Repeat this option
to specify more than one options file."
}
+
+ bool --no-default-options
+ {
+ "Don't load default options files."
+ }
};
}
diff --git a/tests/new.testscript b/tests/new.testscript
index 3c39b47..57263bd 100644
--- a/tests/new.testscript
+++ b/tests/new.testscript
@@ -753,9 +753,15 @@ status += -d prj
--package
EOI
- $* prj 2>>/~%EOE%d != 0
+ $* prj 2>>/~%EOE%d != 0;
%\.+/.build2/bdep-new.options: error: --package in default options file%
EOE
+
+ # Disable default options files loading.
+ #
+ $* --no-default-options prj 2>>/"EOE" &prj/***
+ created new executable project prj in $~/prj/
+ EOE
}
}