Jelajahi Sumber

export: Explicitly allow empty NAMESPACE

Modify argument handling in `HandleExportMode` to explicitly allow an
empty `NAMESPACE`. In practice, this was already the case because we
weren't actually checking for the parsing errors that would cause the
`NonEmpty` decoration to reject an empty value, but we want to be able
to do that going forward, and changing the behavior for `NAMESPACE`
would potentially break legitimate uses. (In particular, one of our unit
tests relies on the current behavior.)
Matthew Woehlke 2 bulan lalu
induk
melakukan
2e71df0156
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      Source/cmExportCommand.cxx

+ 1 - 1
Source/cmExportCommand.cxx

@@ -212,7 +212,7 @@ static bool HandleExportMode(std::vector<std::string> const& args,
   struct ExportArguments
   {
     ArgumentParser::NonEmpty<std::string> ExportSetName;
-    ArgumentParser::NonEmpty<std::string> Namespace;
+    ArgumentParser::MaybeEmpty<std::string> Namespace;
     ArgumentParser::NonEmpty<std::string> Filename;
     ArgumentParser::NonEmpty<std::string> CxxModulesDirectory;
     cm::optional<cmPackageInfoArguments> PackageInfo;