{"record":{"id":"06d2e6380610ac66","repo":"Tencent/matrix","slug":"incorrect-wildcard-type-marker","errorCode":null,"errorMessage":"Incorrect wildcard type marker","messagePattern":"Incorrect wildcard type marker","errorType":"exception","errorClass":"CArcCmdLineException","httpStatus":null,"severity":"error","filePath":"matrix/matrix-android/matrix-backtrace/src/main/cpp/external/libunwindstack/deps/liblzma/CPP/7zip/UI/Common/ArchiveCommandLine.cpp","lineNumber":629,"sourceCode":"      AddNameToCensor(censor, tail, include, recursedType, wildcardMatching);\n    else if (name[pos] == kFileListID)\n      AddToCensorFromListFile(NULL, censor, tail, include, recursedType, wildcardMatching, codePage);\n    #ifdef _WIN32\n    else if (name[pos] == kMapNameID)\n    {\n      errorMessage = ParseMapWithPaths(censor, tail, include, recursedType, wildcardMatching);\n      if (errorMessage)\n        break;\n    }\n    #endif\n    else\n    {\n      errorMessage = \"Incorrect wildcard type marker\";\n      break;\n    }\n  }\n  if (i != strings.Size())\n    throw CArcCmdLineException(errorMessage, strings[i]);\n}\n\n/*\nstatic NUpdateArchive::NPairAction::EEnum GetUpdatePairActionType(int i)\n{\n  switch (i)\n  {\n    case NUpdateArchive::NPairAction::kIgnore: return NUpdateArchive::NPairAction::kIgnore;\n    case NUpdateArchive::NPairAction::kCopy: return NUpdateArchive::NPairAction::kCopy;\n    case NUpdateArchive::NPairAction::kCompress: return NUpdateArchive::NPairAction::kCompress;\n    case NUpdateArchive::NPairAction::kCompressAsAnti: return NUpdateArchive::NPairAction::kCompressAsAnti;\n  }\n  throw 98111603;\n}\n*/\n\nstatic const char * const kUpdatePairStateIDSet = \"pqrxyzw\";\nstatic const int kUpdatePairStateNotSupportedActions[] = {2, 2, 1, -1, -1, -1, -1};","sourceCodeStart":611,"sourceCodeEnd":647,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-backtrace/src/main/cpp/external/libunwindstack/deps/liblzma/CPP/7zip/UI/Common/ArchiveCommandLine.cpp#L611-L647","documentation":"In AddExcludeItem/AddIncludeItem-style switch processing (AddToCensor from -i/-x switches), each post-string must begin with a recognized marker character: an immediate-name marker, a file-list marker (@), or (Windows) a map-name marker. If the marker character is none of these, errorMessage is set to \"Incorrect wildcard type marker\", the loop breaks, and the parser throws the message together with the offending string at ArchiveCommandLine.cpp:629.","triggerScenarios":"Passing an -i or -x switch whose value does not start with a valid marker character, e.g. -ifoobar (missing '!' immediate-name marker) instead of -i!foobar, or a malformed list-file/map reference, causing the switch post-string loop in CArcCmdLineParser::Parse2 to fail at index i.","commonSituations":"Typing an include/exclude wildcard without the required '!' prefix; copying examples between platforms where the map-name marker is Windows-only; building the switch string programmatically and dropping the marker character.","solutions":["Prefix include/exclude items with the correct marker: -i!<wildcard> to include, -x!<wildcard> to exclude.","Use @listfile syntax only for list files: -i@names.txt (and note the map-name form exists only on Windows).","Check the switch value for stray leading characters or a lost '!' or '@' after quoting/expansion.","Validate generated switch strings in scripts before invoking 7z."],"exampleFix":"// before\n7z a out.7z . -x*.log\n// after\n7z a out.7z . -x!*.log","handlingStrategy":"validation","validationCode":"for (const sw of includeExcludeSwitches) { if (!/^[!@]/.test(sw.value) && !(process.platform === 'win32' && sw.value.startsWith('#'))) throw new Error(`switch value must start with '!' or '@': ${sw.value}`); }","typeGuard":"const hasValidMarker = (v) => typeof v === 'string' && (v.startsWith('!') || v.startsWith('@'));","tryCatchPattern":"try { parser.parse2(argv); } catch (e) { if (String(e.message) === 'Incorrect wildcard type marker') { /* fix the -i/-x switch value flagged in the message */ } else throw e; }","preventionTips":["Remember include/exclude wildcard values need the '!' prefix; list files need '@'.","Do not copy map-name switch forms to non-Windows platforms.","Quote switch values in shell so the marker character is not consumed by expansion.","Centralize switch building in one helper that always emits the marker."],"tags":["cli","wildcard","switch-syntax"],"backgroundTag":"invalid-cli-argument","analyzedSha":"3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7","analyzedAt":"2026-09-08T08:01:39.722Z","contentChangedAt":"2026-09-08T08:01:39.722Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}