flashtrace 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/flashtrace.mjs +11 -6
- package/package.json +1 -1
package/dist/flashtrace.mjs
CHANGED
|
@@ -1235,14 +1235,14 @@ Options:
|
|
|
1235
1235
|
-t, --tags <t1,t2,...> only import spec items carrying one of these
|
|
1236
1236
|
tags; add "_" to also include untagged items
|
|
1237
1237
|
-f, --format <format> report format: "text" (default) or "json"; --json
|
|
1238
|
-
is shorthand for --format json
|
|
1239
|
-
selected only once
|
|
1238
|
+
is shorthand for --format json
|
|
1240
1239
|
-v, --verbose list every item with its coverage status and trace
|
|
1241
1240
|
edges, not only the defective ones; text format only
|
|
1242
1241
|
-V, --version print the version number
|
|
1243
1242
|
-h, --help show this help
|
|
1244
1243
|
|
|
1245
1244
|
Long options also accept "="-attached values, e.g. --tags=a,b.
|
|
1245
|
+
The report format and the tag filter may each be selected only once.
|
|
1246
1246
|
|
|
1247
1247
|
Exit codes: 0 clean, 1 defects or problems found, 2 usage error`;
|
|
1248
1248
|
function packageVersion() {
|
|
@@ -1256,11 +1256,15 @@ function splitLongOption(token) {
|
|
|
1256
1256
|
function rejectValue(name, inline) {
|
|
1257
1257
|
if (inline !== void 0) throw new UsageError(`option ${name} does not take a value`);
|
|
1258
1258
|
}
|
|
1259
|
+
function selectOnce(opts, raw, setting, subject) {
|
|
1260
|
+
const selectedBy = opts.selectedBy.get(setting);
|
|
1261
|
+
if (selectedBy !== void 0)
|
|
1262
|
+
throw new UsageError(`${subject} is already selected by ${selectedBy}`);
|
|
1263
|
+
opts.selectedBy.set(setting, raw);
|
|
1264
|
+
}
|
|
1259
1265
|
function selectFormat(opts, raw, format) {
|
|
1260
|
-
|
|
1261
|
-
throw new UsageError(`the report format is already selected by ${opts.formatSelectedBy}`);
|
|
1266
|
+
selectOnce(opts, raw, "format", "the report format");
|
|
1262
1267
|
opts.format = format;
|
|
1263
|
-
opts.formatSelectedBy = raw;
|
|
1264
1268
|
}
|
|
1265
1269
|
function reportFormat(raw, value) {
|
|
1266
1270
|
if (value !== "text" && value !== "json")
|
|
@@ -1298,6 +1302,7 @@ function setFormat(opts, raw, value) {
|
|
|
1298
1302
|
selectFormat(opts, raw, reportFormat(raw, value));
|
|
1299
1303
|
}
|
|
1300
1304
|
function setTags(opts, raw, value) {
|
|
1305
|
+
selectOnce(opts, raw, "tags", "the tag filter");
|
|
1301
1306
|
opts.tags = value.split(",").map((tag) => tag.trim()).filter(Boolean);
|
|
1302
1307
|
}
|
|
1303
1308
|
var VALUED_OPTIONS = /* @__PURE__ */ new Map([
|
|
@@ -1305,7 +1310,7 @@ var VALUED_OPTIONS = /* @__PURE__ */ new Map([
|
|
|
1305
1310
|
["--tags", setTags]
|
|
1306
1311
|
]);
|
|
1307
1312
|
function parseArgs(argv) {
|
|
1308
|
-
const opts = { dirs: [], tags: null, verbose: false, format: "text",
|
|
1313
|
+
const opts = { dirs: [], tags: null, verbose: false, format: "text", selectedBy: /* @__PURE__ */ new Map() };
|
|
1309
1314
|
for (let i = 0; i < argv.length; i++) {
|
|
1310
1315
|
const [raw, inline] = splitLongOption(argv[i]);
|
|
1311
1316
|
const name = LONG_ALIAS[raw] ?? raw;
|