diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-06-12 15:06:00 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-06-12 15:06:00 +0200 |
commit | 8336fe72ab8b4a93c54ca775ca88c567cc91c82c (patch) | |
tree | e387facb04f7837404d9d82982f8c7b3168e95b0 /bdep/config.hxx | |
parent | 0e9a9ec0c6f57a3991b53d2a591d015d8e77d672 (diff) |
Check for configuration name/id/path clash before creating/wiping it (GH issue #241)
Diffstat (limited to 'bdep/config.hxx')
-rw-r--r-- | bdep/config.hxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/bdep/config.hxx b/bdep/config.hxx index 3c66b72..2b4788a 100644 --- a/bdep/config.hxx +++ b/bdep/config.hxx @@ -15,7 +15,9 @@ namespace bdep // If type is nullopt, then assume that an existing configuration is being // added. If that's the case, query the bpkg configuration type and links // and warn the user if any host or build2 configurations are linked, unless - // they are already associated with the project. + // they are already associated with the project. If dry_run is true, then + // make sure the configuration can be added without path/name/id clash but + // don't actually add anything, returning NULL. // shared_ptr<configuration> cmd_config_add (const common_options&, @@ -27,7 +29,8 @@ namespace bdep optional<string> name, optional<string> type, optional<uint64_t> id = nullopt, - const char* what = "added"); + const char* what = "added", + bool dry_run = false); // Configuration directory should exist and its path should be absolute and // normalized. @@ -41,7 +44,8 @@ namespace bdep bool default_ = true, bool forward = true, bool auto_sync = true, - optional<uint64_t> id = nullopt); + optional<uint64_t> id = nullopt, + bool dry_run = false); void cmd_config_add_print (diag_record&, |