@optique/core 1.0.0-dev.1291 → 1.0.0-dev.1300

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.
@@ -1,3 +1,4 @@
1
+ const require_usage = require('./usage.cjs');
1
2
 
2
3
  //#region src/usage-internals.ts
3
4
  /**
@@ -19,11 +20,11 @@ function collectLeadingCandidates(terms, optionNames, commandNames) {
19
20
  if (!terms || !Array.isArray(terms)) return true;
20
21
  for (const term of terms) {
21
22
  if (term.type === "option") {
22
- for (const name of term.names) optionNames.add(name);
23
+ if (!require_usage.isSuggestionHidden(term.hidden)) for (const name of term.names) optionNames.add(name);
23
24
  return false;
24
25
  }
25
26
  if (term.type === "command") {
26
- commandNames.add(term.name);
27
+ if (!require_usage.isSuggestionHidden(term.hidden)) commandNames.add(term.name);
27
28
  return false;
28
29
  }
29
30
  if (term.type === "argument") return false;
@@ -1,3 +1,5 @@
1
+ import { isSuggestionHidden } from "./usage.js";
2
+
1
3
  //#region src/usage-internals.ts
2
4
  /**
3
5
  * Collects option names and command names that are valid as the *immediate*
@@ -18,11 +20,11 @@ function collectLeadingCandidates(terms, optionNames, commandNames) {
18
20
  if (!terms || !Array.isArray(terms)) return true;
19
21
  for (const term of terms) {
20
22
  if (term.type === "option") {
21
- for (const name of term.names) optionNames.add(name);
23
+ if (!isSuggestionHidden(term.hidden)) for (const name of term.names) optionNames.add(name);
22
24
  return false;
23
25
  }
24
26
  if (term.type === "command") {
25
- commandNames.add(term.name);
27
+ if (!isSuggestionHidden(term.hidden)) commandNames.add(term.name);
26
28
  return false;
27
29
  }
28
30
  if (term.type === "argument") return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optique/core",
3
- "version": "1.0.0-dev.1291+36a7f4c9",
3
+ "version": "1.0.0-dev.1300+12293782",
4
4
  "description": "Type-safe combinatorial command-line interface parser",
5
5
  "keywords": [
6
6
  "CLI",