diff --git a/source/dub/commandline.d b/source/dub/commandline.d index 52601b5..861d91f 100644 --- a/source/dub/commandline.d +++ b/source/dub/commandline.d @@ -542,6 +542,7 @@ string m_compilerName; string m_arch; string[] m_debugVersions; + string[] m_overrideConfigs; Compiler m_compiler; BuildPlatform m_buildPlatform; BuildSettings m_buildSettings; @@ -561,6 +562,10 @@ args.getopt("c|config", &m_buildConfig, [ "Builds the specified configuration. Configurations can be defined in dub.json" ]); + args.getopt("override-config", &m_overrideConfigs, [ + "Uses the specified configuration for a certain dependency (format: --override-config /).", + "Can be specified multiple fimes." + ]); args.getopt("compiler", &m_compilerName, [ "Specifies the compiler binary to use (can be a path).", "Arbitrary pre- and suffixes to the identifiers below are recognized (e.g. ldc2 or dmd-2.063) and matched to the proper compiler type:", @@ -611,6 +616,12 @@ else m_buildType = default_build_type; } + foreach (sc; m_overrideConfigs) { + auto idx = sc.indexOf('/'); + enforceUsage(idx >= 0, "Expected \"/\" as argument to --override-config."); + dub.project.overrideConfiguration(sc[0 .. idx], sc[idx+1 .. $]); + } + if (!m_nodeps) { // TODO: only upgrade(select) if necessary, only upgrade(upgrade) every now and then