@optique/core 1.4.0-dev.2740 → 1.4.0-dev.2749
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/constructs.cjs +38 -19
- package/dist/constructs.js +38 -19
- package/dist/facade.cjs +17 -0
- package/dist/facade.js +17 -0
- package/dist/internal/command-doc-metadata.cjs +90 -0
- package/dist/internal/command-doc-metadata.js +87 -0
- package/dist/internal/help-request.cjs +33 -0
- package/dist/internal/help-request.d.cts +20 -0
- package/dist/internal/help-request.d.ts +20 -0
- package/dist/internal/help-request.js +31 -0
- package/dist/modifiers.cjs +3 -2
- package/dist/modifiers.js +3 -2
- package/dist/primitives.cjs +29 -22
- package/dist/primitives.js +29 -22
- package/package.json +10 -2
- package/skills/optique/SKILL.md +1 -1
package/dist/constructs.cjs
CHANGED
|
@@ -13,6 +13,7 @@ const require_empty_input = require('./internal/empty-input.cjs');
|
|
|
13
13
|
const require_execution_context = require('./execution-context.cjs');
|
|
14
14
|
const require_usage_internals = require('./usage-internals.cjs');
|
|
15
15
|
const require_short_option = require('./short-option.cjs');
|
|
16
|
+
const require_command_doc_metadata = require('./internal/command-doc-metadata.cjs');
|
|
16
17
|
const require_passthrough = require('./internal/passthrough.cjs');
|
|
17
18
|
const require_command_alias = require('./internal/command-alias.cjs');
|
|
18
19
|
const require_failure = require('./internal/failure.cjs');
|
|
@@ -1977,6 +1978,7 @@ function or(...args) {
|
|
|
1977
1978
|
children.push(docs);
|
|
1978
1979
|
return docs.fragments;
|
|
1979
1980
|
};
|
|
1981
|
+
let commandMetadata;
|
|
1980
1982
|
let brief;
|
|
1981
1983
|
let description;
|
|
1982
1984
|
let footer;
|
|
@@ -1989,19 +1991,20 @@ function or(...args) {
|
|
|
1989
1991
|
state: parserResult.next.state
|
|
1990
1992
|
} : { kind: "unavailable" };
|
|
1991
1993
|
const docFragments = parsers[index].getDocFragments(innerState, void 0);
|
|
1994
|
+
commandMetadata = require_command_doc_metadata.getCommandDocMetadata(docFragments);
|
|
1992
1995
|
brief = docFragments.brief;
|
|
1993
1996
|
description = docFragments.description;
|
|
1994
1997
|
footer = docFragments.footer;
|
|
1995
1998
|
fragments = collect(docFragments);
|
|
1996
1999
|
}
|
|
1997
2000
|
if (state.kind === "unavailable" || state.state == null) fragments = require_doc.deduplicateDocFragments(fragments);
|
|
1998
|
-
return {
|
|
2001
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
1999
2002
|
...sourceDocumentation(children),
|
|
2000
2003
|
brief,
|
|
2001
2004
|
description,
|
|
2002
2005
|
footer,
|
|
2003
2006
|
fragments
|
|
2004
|
-
};
|
|
2007
|
+
}, commandMetadata);
|
|
2005
2008
|
}
|
|
2006
2009
|
};
|
|
2007
2010
|
const singleDependencyMetadata = composeExclusiveDependencyMetadata(parsers);
|
|
@@ -2214,6 +2217,7 @@ function createLongestMatch(...args) {
|
|
|
2214
2217
|
children.push(docs);
|
|
2215
2218
|
return docs.fragments;
|
|
2216
2219
|
};
|
|
2220
|
+
let commandMetadata;
|
|
2217
2221
|
let brief;
|
|
2218
2222
|
let description;
|
|
2219
2223
|
let footer;
|
|
@@ -2229,6 +2233,7 @@ function createLongestMatch(...args) {
|
|
|
2229
2233
|
kind: "available",
|
|
2230
2234
|
state: result.next.state
|
|
2231
2235
|
});
|
|
2236
|
+
commandMetadata = require_command_doc_metadata.getCommandDocMetadata(docResult);
|
|
2232
2237
|
brief = docResult.brief;
|
|
2233
2238
|
description = docResult.description;
|
|
2234
2239
|
footer = docResult.footer;
|
|
@@ -2239,13 +2244,13 @@ function createLongestMatch(...args) {
|
|
|
2239
2244
|
shouldDeduplicate = true;
|
|
2240
2245
|
}
|
|
2241
2246
|
}
|
|
2242
|
-
return {
|
|
2247
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
2243
2248
|
...sourceDocumentation(children),
|
|
2244
2249
|
brief,
|
|
2245
2250
|
description,
|
|
2246
2251
|
fragments: shouldDeduplicate ? require_doc.deduplicateDocFragments(fragments) : fragments,
|
|
2247
2252
|
footer
|
|
2248
|
-
};
|
|
2253
|
+
}, commandMetadata);
|
|
2249
2254
|
}
|
|
2250
2255
|
};
|
|
2251
2256
|
const multiDependencyMetadata = composeExclusiveDependencyMetadata(parsers);
|
|
@@ -3252,12 +3257,15 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
3252
3257
|
children.push(docs);
|
|
3253
3258
|
return docs.fragments;
|
|
3254
3259
|
};
|
|
3260
|
+
let commandMetadata;
|
|
3255
3261
|
const fragments = parserPairs.flatMap(([field, p]) => {
|
|
3256
3262
|
const fieldState = state.kind === "unavailable" ? { kind: "unavailable" } : {
|
|
3257
3263
|
kind: "available",
|
|
3258
3264
|
state: state.state[field]
|
|
3259
3265
|
};
|
|
3260
|
-
|
|
3266
|
+
const docs = p.getDocFragments(fieldState, defaultValue?.[field]);
|
|
3267
|
+
commandMetadata = require_command_doc_metadata.collectCommandDocMetadata(commandMetadata, docs);
|
|
3268
|
+
return collect(docs);
|
|
3261
3269
|
});
|
|
3262
3270
|
const hiddenAwareFragments = applyHiddenToDocFragments(fragments, options.hidden);
|
|
3263
3271
|
const entries = hiddenAwareFragments.filter((d) => d.type === "entry");
|
|
@@ -3272,13 +3280,14 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
3272
3280
|
entries
|
|
3273
3281
|
};
|
|
3274
3282
|
sections.push(section);
|
|
3275
|
-
return {
|
|
3283
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
3276
3284
|
...sourceDocumentation(children, options.hidden),
|
|
3285
|
+
...commandMetadata,
|
|
3277
3286
|
fragments: sections.map((s) => ({
|
|
3278
3287
|
...s,
|
|
3279
3288
|
type: "section"
|
|
3280
3289
|
}))
|
|
3281
|
-
};
|
|
3290
|
+
}, commandMetadata);
|
|
3282
3291
|
}
|
|
3283
3292
|
};
|
|
3284
3293
|
const fieldNormalizers = [];
|
|
@@ -4304,12 +4313,15 @@ function tuple(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
4304
4313
|
children.push(docs);
|
|
4305
4314
|
return docs.fragments;
|
|
4306
4315
|
};
|
|
4316
|
+
let commandMetadata;
|
|
4307
4317
|
const fragments = syncParsers.flatMap((p, i) => {
|
|
4308
4318
|
const indexState = state.kind === "unavailable" ? { kind: "unavailable" } : {
|
|
4309
4319
|
kind: "available",
|
|
4310
4320
|
state: state.state[i]
|
|
4311
4321
|
};
|
|
4312
|
-
|
|
4322
|
+
const docs = p.getDocFragments(indexState, defaultValue?.[i]);
|
|
4323
|
+
commandMetadata = require_command_doc_metadata.collectCommandDocMetadata(commandMetadata, docs);
|
|
4324
|
+
return collect(docs);
|
|
4313
4325
|
});
|
|
4314
4326
|
const entries = fragments.filter((d) => d.type === "entry");
|
|
4315
4327
|
const sections = [];
|
|
@@ -4323,13 +4335,14 @@ function tuple(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
4323
4335
|
entries
|
|
4324
4336
|
};
|
|
4325
4337
|
sections.push(section);
|
|
4326
|
-
return {
|
|
4338
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
4327
4339
|
...sourceDocumentation(children),
|
|
4340
|
+
...commandMetadata,
|
|
4328
4341
|
fragments: sections.map((s) => ({
|
|
4329
4342
|
...s,
|
|
4330
4343
|
type: "section"
|
|
4331
4344
|
}))
|
|
4332
|
-
};
|
|
4345
|
+
}, commandMetadata);
|
|
4333
4346
|
},
|
|
4334
4347
|
[Symbol.for("Deno.customInspect")]() {
|
|
4335
4348
|
const parsersStr = parsers.length === 1 ? `[1 parser]` : `[${parsers.length} parsers]`;
|
|
@@ -5688,6 +5701,7 @@ function merge(...args) {
|
|
|
5688
5701
|
children.push(docs);
|
|
5689
5702
|
return docs.fragments;
|
|
5690
5703
|
};
|
|
5704
|
+
let commandMetadata;
|
|
5691
5705
|
let brief;
|
|
5692
5706
|
let description;
|
|
5693
5707
|
let footer;
|
|
@@ -5705,6 +5719,7 @@ function merge(...args) {
|
|
|
5705
5719
|
state: state.state
|
|
5706
5720
|
};
|
|
5707
5721
|
const docFragments = p.getDocFragments(parserState, void 0);
|
|
5722
|
+
commandMetadata = require_command_doc_metadata.collectCommandDocMetadata(commandMetadata, docFragments, true);
|
|
5708
5723
|
brief ??= docFragments.brief;
|
|
5709
5724
|
description ??= docFragments.description;
|
|
5710
5725
|
footer ??= docFragments.footer;
|
|
@@ -5724,7 +5739,7 @@ function merge(...args) {
|
|
|
5724
5739
|
entries
|
|
5725
5740
|
};
|
|
5726
5741
|
sections.push(labeledSection);
|
|
5727
|
-
return {
|
|
5742
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
5728
5743
|
...sourceDocumentation(children, options.hidden),
|
|
5729
5744
|
brief,
|
|
5730
5745
|
description,
|
|
@@ -5733,9 +5748,9 @@ function merge(...args) {
|
|
|
5733
5748
|
...s,
|
|
5734
5749
|
type: "section"
|
|
5735
5750
|
}))
|
|
5736
|
-
};
|
|
5751
|
+
}, commandMetadata);
|
|
5737
5752
|
}
|
|
5738
|
-
return {
|
|
5753
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
5739
5754
|
...sourceDocumentation(children, options.hidden),
|
|
5740
5755
|
brief,
|
|
5741
5756
|
description,
|
|
@@ -5747,7 +5762,7 @@ function merge(...args) {
|
|
|
5747
5762
|
type: "section",
|
|
5748
5763
|
entries
|
|
5749
5764
|
}]
|
|
5750
|
-
};
|
|
5765
|
+
}, commandMetadata);
|
|
5751
5766
|
}
|
|
5752
5767
|
};
|
|
5753
5768
|
require_internal_parser.defineParseLanes(mergeParser, mergeParseLanes);
|
|
@@ -6383,12 +6398,15 @@ function concat(...parsers) {
|
|
|
6383
6398
|
children.push(docs);
|
|
6384
6399
|
return docs.fragments;
|
|
6385
6400
|
};
|
|
6401
|
+
let commandMetadata;
|
|
6386
6402
|
const fragments = syncParsers.flatMap((p, index) => {
|
|
6387
6403
|
const indexState = state.kind === "unavailable" ? { kind: "unavailable" } : {
|
|
6388
6404
|
kind: "available",
|
|
6389
6405
|
state: state.state[index]
|
|
6390
6406
|
};
|
|
6391
|
-
|
|
6407
|
+
const docs = p.getDocFragments(indexState, void 0);
|
|
6408
|
+
commandMetadata = require_command_doc_metadata.collectCommandDocMetadata(commandMetadata, docs);
|
|
6409
|
+
return collect(docs);
|
|
6392
6410
|
});
|
|
6393
6411
|
const entries = fragments.filter((f) => f.type === "entry");
|
|
6394
6412
|
const sections = [];
|
|
@@ -6405,10 +6423,11 @@ function concat(...parsers) {
|
|
|
6405
6423
|
type: "section",
|
|
6406
6424
|
entries
|
|
6407
6425
|
});
|
|
6408
|
-
return {
|
|
6426
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
6409
6427
|
...sourceDocumentation(children),
|
|
6428
|
+
...commandMetadata,
|
|
6410
6429
|
fragments: result
|
|
6411
|
-
};
|
|
6430
|
+
}, commandMetadata);
|
|
6412
6431
|
}
|
|
6413
6432
|
};
|
|
6414
6433
|
require_internal_parser.defineInheritedAnnotationParser(concatParser);
|
|
@@ -6479,7 +6498,7 @@ function group(label, parser, options = {}) {
|
|
|
6479
6498
|
title: label,
|
|
6480
6499
|
entries: allEntries
|
|
6481
6500
|
} : { entries: allEntries };
|
|
6482
|
-
return {
|
|
6501
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
6483
6502
|
...sourceDocumentation(children, options.hidden),
|
|
6484
6503
|
brief,
|
|
6485
6504
|
description,
|
|
@@ -6491,7 +6510,7 @@ function group(label, parser, options = {}) {
|
|
|
6491
6510
|
type: "section",
|
|
6492
6511
|
...labeledSection
|
|
6493
6512
|
}]
|
|
6494
|
-
};
|
|
6513
|
+
}, require_command_doc_metadata.getCommandDocMetadata(docs));
|
|
6495
6514
|
}
|
|
6496
6515
|
};
|
|
6497
6516
|
require_internal_parser.defineParseLanes(groupParser, require_internal_parser.getOwnParseLanes(parser));
|
package/dist/constructs.js
CHANGED
|
@@ -13,6 +13,7 @@ import { acceptsEmptyInput, getEmptyInputFacts, longestMatchFacts, objectFacts,
|
|
|
13
13
|
import { mergeChildExec, withChildContext, withChildExecPath } from "./execution-context.js";
|
|
14
14
|
import { collectLeadingCandidates } from "./usage-internals.js";
|
|
15
15
|
import { adoptOptionScope, combinedOptionScope, conditionalOptionScope, forkOptionScope, restoreOptionScope, scopeParser, selectableOptionScope, withOptionScope, withParserOptionScope } from "./short-option.js";
|
|
16
|
+
import { collectCommandDocMetadata, getCommandDocMetadata, withCommandDocMetadata } from "./internal/command-doc-metadata.js";
|
|
16
17
|
import { defineReachableChildren, delegateKnownCompletion, getKnownCompletion, getOptionMatch, getPassThroughFailureHint, getPassThroughPriority, hasPassThroughUsage, matchesOptionToken, retainConsumingFailure, retainConsumingFailureHint, withPassThroughFailure, withReturnedConsumingFailure } from "./internal/passthrough.js";
|
|
17
18
|
import { allowDuplicateLeadingCommandNamesKey } from "./internal/command-alias.js";
|
|
18
19
|
import { createDeferredFailure, withConsumedDepth } from "./internal/failure.js";
|
|
@@ -1977,6 +1978,7 @@ function or(...args) {
|
|
|
1977
1978
|
children.push(docs);
|
|
1978
1979
|
return docs.fragments;
|
|
1979
1980
|
};
|
|
1981
|
+
let commandMetadata;
|
|
1980
1982
|
let brief;
|
|
1981
1983
|
let description;
|
|
1982
1984
|
let footer;
|
|
@@ -1989,19 +1991,20 @@ function or(...args) {
|
|
|
1989
1991
|
state: parserResult.next.state
|
|
1990
1992
|
} : { kind: "unavailable" };
|
|
1991
1993
|
const docFragments = parsers[index].getDocFragments(innerState, void 0);
|
|
1994
|
+
commandMetadata = getCommandDocMetadata(docFragments);
|
|
1992
1995
|
brief = docFragments.brief;
|
|
1993
1996
|
description = docFragments.description;
|
|
1994
1997
|
footer = docFragments.footer;
|
|
1995
1998
|
fragments = collect(docFragments);
|
|
1996
1999
|
}
|
|
1997
2000
|
if (state.kind === "unavailable" || state.state == null) fragments = deduplicateDocFragments(fragments);
|
|
1998
|
-
return {
|
|
2001
|
+
return withCommandDocMetadata({
|
|
1999
2002
|
...sourceDocumentation(children),
|
|
2000
2003
|
brief,
|
|
2001
2004
|
description,
|
|
2002
2005
|
footer,
|
|
2003
2006
|
fragments
|
|
2004
|
-
};
|
|
2007
|
+
}, commandMetadata);
|
|
2005
2008
|
}
|
|
2006
2009
|
};
|
|
2007
2010
|
const singleDependencyMetadata = composeExclusiveDependencyMetadata(parsers);
|
|
@@ -2214,6 +2217,7 @@ function createLongestMatch(...args) {
|
|
|
2214
2217
|
children.push(docs);
|
|
2215
2218
|
return docs.fragments;
|
|
2216
2219
|
};
|
|
2220
|
+
let commandMetadata;
|
|
2217
2221
|
let brief;
|
|
2218
2222
|
let description;
|
|
2219
2223
|
let footer;
|
|
@@ -2229,6 +2233,7 @@ function createLongestMatch(...args) {
|
|
|
2229
2233
|
kind: "available",
|
|
2230
2234
|
state: result.next.state
|
|
2231
2235
|
});
|
|
2236
|
+
commandMetadata = getCommandDocMetadata(docResult);
|
|
2232
2237
|
brief = docResult.brief;
|
|
2233
2238
|
description = docResult.description;
|
|
2234
2239
|
footer = docResult.footer;
|
|
@@ -2239,13 +2244,13 @@ function createLongestMatch(...args) {
|
|
|
2239
2244
|
shouldDeduplicate = true;
|
|
2240
2245
|
}
|
|
2241
2246
|
}
|
|
2242
|
-
return {
|
|
2247
|
+
return withCommandDocMetadata({
|
|
2243
2248
|
...sourceDocumentation(children),
|
|
2244
2249
|
brief,
|
|
2245
2250
|
description,
|
|
2246
2251
|
fragments: shouldDeduplicate ? deduplicateDocFragments(fragments) : fragments,
|
|
2247
2252
|
footer
|
|
2248
|
-
};
|
|
2253
|
+
}, commandMetadata);
|
|
2249
2254
|
}
|
|
2250
2255
|
};
|
|
2251
2256
|
const multiDependencyMetadata = composeExclusiveDependencyMetadata(parsers);
|
|
@@ -3252,12 +3257,15 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
3252
3257
|
children.push(docs);
|
|
3253
3258
|
return docs.fragments;
|
|
3254
3259
|
};
|
|
3260
|
+
let commandMetadata;
|
|
3255
3261
|
const fragments = parserPairs.flatMap(([field, p]) => {
|
|
3256
3262
|
const fieldState = state.kind === "unavailable" ? { kind: "unavailable" } : {
|
|
3257
3263
|
kind: "available",
|
|
3258
3264
|
state: state.state[field]
|
|
3259
3265
|
};
|
|
3260
|
-
|
|
3266
|
+
const docs = p.getDocFragments(fieldState, defaultValue?.[field]);
|
|
3267
|
+
commandMetadata = collectCommandDocMetadata(commandMetadata, docs);
|
|
3268
|
+
return collect(docs);
|
|
3261
3269
|
});
|
|
3262
3270
|
const hiddenAwareFragments = applyHiddenToDocFragments(fragments, options.hidden);
|
|
3263
3271
|
const entries = hiddenAwareFragments.filter((d) => d.type === "entry");
|
|
@@ -3272,13 +3280,14 @@ function object(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
3272
3280
|
entries
|
|
3273
3281
|
};
|
|
3274
3282
|
sections.push(section);
|
|
3275
|
-
return {
|
|
3283
|
+
return withCommandDocMetadata({
|
|
3276
3284
|
...sourceDocumentation(children, options.hidden),
|
|
3285
|
+
...commandMetadata,
|
|
3277
3286
|
fragments: sections.map((s) => ({
|
|
3278
3287
|
...s,
|
|
3279
3288
|
type: "section"
|
|
3280
3289
|
}))
|
|
3281
|
-
};
|
|
3290
|
+
}, commandMetadata);
|
|
3282
3291
|
}
|
|
3283
3292
|
};
|
|
3284
3293
|
const fieldNormalizers = [];
|
|
@@ -4304,12 +4313,15 @@ function tuple(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
4304
4313
|
children.push(docs);
|
|
4305
4314
|
return docs.fragments;
|
|
4306
4315
|
};
|
|
4316
|
+
let commandMetadata;
|
|
4307
4317
|
const fragments = syncParsers.flatMap((p, i) => {
|
|
4308
4318
|
const indexState = state.kind === "unavailable" ? { kind: "unavailable" } : {
|
|
4309
4319
|
kind: "available",
|
|
4310
4320
|
state: state.state[i]
|
|
4311
4321
|
};
|
|
4312
|
-
|
|
4322
|
+
const docs = p.getDocFragments(indexState, defaultValue?.[i]);
|
|
4323
|
+
commandMetadata = collectCommandDocMetadata(commandMetadata, docs);
|
|
4324
|
+
return collect(docs);
|
|
4313
4325
|
});
|
|
4314
4326
|
const entries = fragments.filter((d) => d.type === "entry");
|
|
4315
4327
|
const sections = [];
|
|
@@ -4323,13 +4335,14 @@ function tuple(labelOrParsers, maybeParsersOrOptions, maybeOptions) {
|
|
|
4323
4335
|
entries
|
|
4324
4336
|
};
|
|
4325
4337
|
sections.push(section);
|
|
4326
|
-
return {
|
|
4338
|
+
return withCommandDocMetadata({
|
|
4327
4339
|
...sourceDocumentation(children),
|
|
4340
|
+
...commandMetadata,
|
|
4328
4341
|
fragments: sections.map((s) => ({
|
|
4329
4342
|
...s,
|
|
4330
4343
|
type: "section"
|
|
4331
4344
|
}))
|
|
4332
|
-
};
|
|
4345
|
+
}, commandMetadata);
|
|
4333
4346
|
},
|
|
4334
4347
|
[Symbol.for("Deno.customInspect")]() {
|
|
4335
4348
|
const parsersStr = parsers.length === 1 ? `[1 parser]` : `[${parsers.length} parsers]`;
|
|
@@ -5688,6 +5701,7 @@ function merge(...args) {
|
|
|
5688
5701
|
children.push(docs);
|
|
5689
5702
|
return docs.fragments;
|
|
5690
5703
|
};
|
|
5704
|
+
let commandMetadata;
|
|
5691
5705
|
let brief;
|
|
5692
5706
|
let description;
|
|
5693
5707
|
let footer;
|
|
@@ -5705,6 +5719,7 @@ function merge(...args) {
|
|
|
5705
5719
|
state: state.state
|
|
5706
5720
|
};
|
|
5707
5721
|
const docFragments = p.getDocFragments(parserState, void 0);
|
|
5722
|
+
commandMetadata = collectCommandDocMetadata(commandMetadata, docFragments, true);
|
|
5708
5723
|
brief ??= docFragments.brief;
|
|
5709
5724
|
description ??= docFragments.description;
|
|
5710
5725
|
footer ??= docFragments.footer;
|
|
@@ -5724,7 +5739,7 @@ function merge(...args) {
|
|
|
5724
5739
|
entries
|
|
5725
5740
|
};
|
|
5726
5741
|
sections.push(labeledSection);
|
|
5727
|
-
return {
|
|
5742
|
+
return withCommandDocMetadata({
|
|
5728
5743
|
...sourceDocumentation(children, options.hidden),
|
|
5729
5744
|
brief,
|
|
5730
5745
|
description,
|
|
@@ -5733,9 +5748,9 @@ function merge(...args) {
|
|
|
5733
5748
|
...s,
|
|
5734
5749
|
type: "section"
|
|
5735
5750
|
}))
|
|
5736
|
-
};
|
|
5751
|
+
}, commandMetadata);
|
|
5737
5752
|
}
|
|
5738
|
-
return {
|
|
5753
|
+
return withCommandDocMetadata({
|
|
5739
5754
|
...sourceDocumentation(children, options.hidden),
|
|
5740
5755
|
brief,
|
|
5741
5756
|
description,
|
|
@@ -5747,7 +5762,7 @@ function merge(...args) {
|
|
|
5747
5762
|
type: "section",
|
|
5748
5763
|
entries
|
|
5749
5764
|
}]
|
|
5750
|
-
};
|
|
5765
|
+
}, commandMetadata);
|
|
5751
5766
|
}
|
|
5752
5767
|
};
|
|
5753
5768
|
defineParseLanes(mergeParser, mergeParseLanes);
|
|
@@ -6383,12 +6398,15 @@ function concat(...parsers) {
|
|
|
6383
6398
|
children.push(docs);
|
|
6384
6399
|
return docs.fragments;
|
|
6385
6400
|
};
|
|
6401
|
+
let commandMetadata;
|
|
6386
6402
|
const fragments = syncParsers.flatMap((p, index) => {
|
|
6387
6403
|
const indexState = state.kind === "unavailable" ? { kind: "unavailable" } : {
|
|
6388
6404
|
kind: "available",
|
|
6389
6405
|
state: state.state[index]
|
|
6390
6406
|
};
|
|
6391
|
-
|
|
6407
|
+
const docs = p.getDocFragments(indexState, void 0);
|
|
6408
|
+
commandMetadata = collectCommandDocMetadata(commandMetadata, docs);
|
|
6409
|
+
return collect(docs);
|
|
6392
6410
|
});
|
|
6393
6411
|
const entries = fragments.filter((f) => f.type === "entry");
|
|
6394
6412
|
const sections = [];
|
|
@@ -6405,10 +6423,11 @@ function concat(...parsers) {
|
|
|
6405
6423
|
type: "section",
|
|
6406
6424
|
entries
|
|
6407
6425
|
});
|
|
6408
|
-
return {
|
|
6426
|
+
return withCommandDocMetadata({
|
|
6409
6427
|
...sourceDocumentation(children),
|
|
6428
|
+
...commandMetadata,
|
|
6410
6429
|
fragments: result
|
|
6411
|
-
};
|
|
6430
|
+
}, commandMetadata);
|
|
6412
6431
|
}
|
|
6413
6432
|
};
|
|
6414
6433
|
defineInheritedAnnotationParser(concatParser);
|
|
@@ -6479,7 +6498,7 @@ function group(label, parser, options = {}) {
|
|
|
6479
6498
|
title: label,
|
|
6480
6499
|
entries: allEntries
|
|
6481
6500
|
} : { entries: allEntries };
|
|
6482
|
-
return {
|
|
6501
|
+
return withCommandDocMetadata({
|
|
6483
6502
|
...sourceDocumentation(children, options.hidden),
|
|
6484
6503
|
brief,
|
|
6485
6504
|
description,
|
|
@@ -6491,7 +6510,7 @@ function group(label, parser, options = {}) {
|
|
|
6491
6510
|
type: "section",
|
|
6492
6511
|
...labeledSection
|
|
6493
6512
|
}]
|
|
6494
|
-
};
|
|
6513
|
+
}, getCommandDocMetadata(docs));
|
|
6495
6514
|
}
|
|
6496
6515
|
};
|
|
6497
6516
|
defineParseLanes(groupParser, getOwnParseLanes(parser));
|
package/dist/facade.cjs
CHANGED
|
@@ -17,6 +17,7 @@ const require_command_alias = require('./internal/command-alias.cjs');
|
|
|
17
17
|
const require_phase2_seed = require('./phase2-seed.cjs');
|
|
18
18
|
const require_modifiers = require('./modifiers.cjs');
|
|
19
19
|
const require_constructs = require('./constructs.cjs');
|
|
20
|
+
const require_internal_help_request = require('./internal/help-request.cjs');
|
|
20
21
|
const require_valueparser = require('./valueparser.cjs');
|
|
21
22
|
const require_primitives = require('./primitives.cjs');
|
|
22
23
|
|
|
@@ -1145,6 +1146,20 @@ function runParser(parserOrProgram, programNameOrArgs, argsOrOptions, optionsPar
|
|
|
1145
1146
|
}
|
|
1146
1147
|
};
|
|
1147
1148
|
const parserMode = parser.mode;
|
|
1149
|
+
const helpRequest = require_internal_help_request.getHelpRequest(options);
|
|
1150
|
+
if (helpRequest != null) return require_mode_dispatch.dispatchByMode(parserMode, () => {
|
|
1151
|
+
const handled = handleResult({
|
|
1152
|
+
type: "help",
|
|
1153
|
+
commands: helpRequest,
|
|
1154
|
+
preferUserCommandDocs: true
|
|
1155
|
+
});
|
|
1156
|
+
if (handled instanceof Promise) throw new RunParserError("Synchronous parser returned async result.");
|
|
1157
|
+
return handled;
|
|
1158
|
+
}, async () => await handleResult({
|
|
1159
|
+
type: "help",
|
|
1160
|
+
commands: helpRequest,
|
|
1161
|
+
preferUserCommandDocs: true
|
|
1162
|
+
}));
|
|
1148
1163
|
return require_mode_dispatch.dispatchByMode(parserMode, () => {
|
|
1149
1164
|
const attempted = require_internal_parser.attemptParseSync(parser, args, {
|
|
1150
1165
|
mode: "complete",
|
|
@@ -1368,6 +1383,7 @@ function shouldProbeEarlyExit(options, needsTwoPhase) {
|
|
|
1368
1383
|
* handled without collecting source-context annotations first.
|
|
1369
1384
|
*/
|
|
1370
1385
|
function needsEarlyExitSync(parser, args, options) {
|
|
1386
|
+
if (require_internal_help_request.getHelpRequest(options) != null) return true;
|
|
1371
1387
|
const attempted = require_internal_parser.attemptParseSync(parser, args, { mode: "parse-only" });
|
|
1372
1388
|
if (attempted.kind === "success") return false;
|
|
1373
1389
|
return isMetaEarlyExit(classifyEarlyExitFailure(attempted, options));
|
|
@@ -1376,6 +1392,7 @@ function needsEarlyExitSync(parser, args, options) {
|
|
|
1376
1392
|
* Async variant of {@link needsEarlyExitSync}.
|
|
1377
1393
|
*/
|
|
1378
1394
|
async function needsEarlyExitAsync(parser, args, options) {
|
|
1395
|
+
if (require_internal_help_request.getHelpRequest(options) != null) return true;
|
|
1379
1396
|
const attempted = await require_internal_parser.attemptParseAsync(parser, args, { mode: "parse-only" });
|
|
1380
1397
|
if (attempted.kind === "success") return false;
|
|
1381
1398
|
return isMetaEarlyExit(classifyEarlyExitFailure(attempted, options));
|
package/dist/facade.js
CHANGED
|
@@ -17,6 +17,7 @@ import { allowDuplicateLeadingCommandNamesKey, hiddenCommandAliasesKey } from ".
|
|
|
17
17
|
import { completeOrExtractPhase2Seed } from "./phase2-seed.js";
|
|
18
18
|
import { multiple, optional, withDefault } from "./modifiers.js";
|
|
19
19
|
import { group, longestMatch, object } from "./constructs.js";
|
|
20
|
+
import { getHelpRequest } from "./internal/help-request.js";
|
|
20
21
|
import { string } from "./valueparser.js";
|
|
21
22
|
import { argument, command, constant, flag, option } from "./primitives.js";
|
|
22
23
|
|
|
@@ -1145,6 +1146,20 @@ function runParser(parserOrProgram, programNameOrArgs, argsOrOptions, optionsPar
|
|
|
1145
1146
|
}
|
|
1146
1147
|
};
|
|
1147
1148
|
const parserMode = parser.mode;
|
|
1149
|
+
const helpRequest = getHelpRequest(options);
|
|
1150
|
+
if (helpRequest != null) return dispatchByMode(parserMode, () => {
|
|
1151
|
+
const handled = handleResult({
|
|
1152
|
+
type: "help",
|
|
1153
|
+
commands: helpRequest,
|
|
1154
|
+
preferUserCommandDocs: true
|
|
1155
|
+
});
|
|
1156
|
+
if (handled instanceof Promise) throw new RunParserError("Synchronous parser returned async result.");
|
|
1157
|
+
return handled;
|
|
1158
|
+
}, async () => await handleResult({
|
|
1159
|
+
type: "help",
|
|
1160
|
+
commands: helpRequest,
|
|
1161
|
+
preferUserCommandDocs: true
|
|
1162
|
+
}));
|
|
1148
1163
|
return dispatchByMode(parserMode, () => {
|
|
1149
1164
|
const attempted = attemptParseSync(parser, args, {
|
|
1150
1165
|
mode: "complete",
|
|
@@ -1368,6 +1383,7 @@ function shouldProbeEarlyExit(options, needsTwoPhase) {
|
|
|
1368
1383
|
* handled without collecting source-context annotations first.
|
|
1369
1384
|
*/
|
|
1370
1385
|
function needsEarlyExitSync(parser, args, options) {
|
|
1386
|
+
if (getHelpRequest(options) != null) return true;
|
|
1371
1387
|
const attempted = attemptParseSync(parser, args, { mode: "parse-only" });
|
|
1372
1388
|
if (attempted.kind === "success") return false;
|
|
1373
1389
|
return isMetaEarlyExit(classifyEarlyExitFailure(attempted, options));
|
|
@@ -1376,6 +1392,7 @@ function needsEarlyExitSync(parser, args, options) {
|
|
|
1376
1392
|
* Async variant of {@link needsEarlyExitSync}.
|
|
1377
1393
|
*/
|
|
1378
1394
|
async function needsEarlyExitAsync(parser, args, options) {
|
|
1395
|
+
if (getHelpRequest(options) != null) return true;
|
|
1379
1396
|
const attempted = await attemptParseAsync(parser, args, { mode: "parse-only" });
|
|
1380
1397
|
if (attempted.kind === "success") return false;
|
|
1381
1398
|
return isMetaEarlyExit(classifyEarlyExitFailure(attempted, options));
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/internal/command-doc-metadata.ts
|
|
3
|
+
function withOrigin(metadata, origin) {
|
|
4
|
+
const result = { ...metadata };
|
|
5
|
+
Object.defineProperty(result, "origin", {
|
|
6
|
+
value: origin,
|
|
7
|
+
enumerable: false
|
|
8
|
+
});
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
const commandDocMetadata = Symbol.for("@optique/core/commandDocMetadata");
|
|
12
|
+
const commandDocCarrier = Symbol.for("@optique/core/commandDocMetadataCarrier");
|
|
13
|
+
/**
|
|
14
|
+
* Reads effective page metadata, including custom collection-level fields.
|
|
15
|
+
* @param docs The child's documentation.
|
|
16
|
+
* @returns Its selected-command metadata, if any.
|
|
17
|
+
*/
|
|
18
|
+
function getCommandDocMetadata(docs) {
|
|
19
|
+
const carrier = docs.fragments[commandDocCarrier];
|
|
20
|
+
if (carrier != null) {
|
|
21
|
+
const brief = docs.brief === carrier.brief ? carrier.metadata.brief : docs.brief;
|
|
22
|
+
const origin = carrier.metadata.origin ?? "entry";
|
|
23
|
+
const customPage = origin === "entry" && (docs.brief !== carrier.brief || docs.footer !== carrier.footer);
|
|
24
|
+
const description = origin === "entry" && !customPage || docs.description === carrier.description ? carrier.metadata.description : docs.description;
|
|
25
|
+
const footer = docs.footer === carrier.footer ? carrier.metadata.footer : docs.footer;
|
|
26
|
+
return withOrigin({
|
|
27
|
+
...brief == null ? {} : { brief },
|
|
28
|
+
...description == null ? {} : { description },
|
|
29
|
+
...footer == null ? {} : { footer }
|
|
30
|
+
}, customPage ? "custom" : origin);
|
|
31
|
+
}
|
|
32
|
+
const metadata = docs[commandDocMetadata];
|
|
33
|
+
if (metadata != null) return metadata;
|
|
34
|
+
return docs.brief != null || docs.description != null || docs.footer != null ? withOrigin({
|
|
35
|
+
brief: docs.brief,
|
|
36
|
+
description: docs.description,
|
|
37
|
+
footer: docs.footer
|
|
38
|
+
}, "custom") : void 0;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Preserves selected-command metadata when rebuilding documentation fragments.
|
|
42
|
+
* @param docs The rebuilt documentation.
|
|
43
|
+
* @param metadata The selected-command metadata to preserve.
|
|
44
|
+
* @returns Documentation with the internal metadata attached.
|
|
45
|
+
*/
|
|
46
|
+
function withCommandDocMetadata(docs, metadata) {
|
|
47
|
+
if (metadata == null) return docs;
|
|
48
|
+
metadata = withOrigin(metadata, metadata.origin ?? "entry");
|
|
49
|
+
const fragments = [...docs.fragments];
|
|
50
|
+
Object.defineProperty(fragments, commandDocCarrier, { value: {
|
|
51
|
+
metadata,
|
|
52
|
+
brief: docs.brief,
|
|
53
|
+
description: docs.description,
|
|
54
|
+
footer: docs.footer
|
|
55
|
+
} });
|
|
56
|
+
const result = {
|
|
57
|
+
...docs,
|
|
58
|
+
fragments
|
|
59
|
+
};
|
|
60
|
+
Object.defineProperty(result, commandDocMetadata, { value: metadata });
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Collects selected-command metadata in documentation traversal order.
|
|
65
|
+
* @param current Metadata from earlier children.
|
|
66
|
+
* @param docs The next child's documentation.
|
|
67
|
+
* @param includeCustom Whether to retain custom page fields inside merge().
|
|
68
|
+
* @returns The first defined value from children with the same origin.
|
|
69
|
+
*/
|
|
70
|
+
function collectCommandDocMetadata(current, docs, includeCustom = false) {
|
|
71
|
+
const next = getCommandDocMetadata(docs);
|
|
72
|
+
if (next == null) return current;
|
|
73
|
+
const origin = next.origin ?? "entry";
|
|
74
|
+
if (origin === "entry" || origin === "custom" && !includeCustom) return current ?? withOrigin({}, "entry");
|
|
75
|
+
if (current?.origin === "command" && origin !== "command") return current;
|
|
76
|
+
if (current?.origin !== origin) current = void 0;
|
|
77
|
+
const brief = current?.brief ?? next.brief;
|
|
78
|
+
const description = current?.description ?? next.description;
|
|
79
|
+
const footer = current?.footer ?? next.footer;
|
|
80
|
+
return withOrigin({
|
|
81
|
+
...brief == null ? {} : { brief },
|
|
82
|
+
...description == null ? {} : { description },
|
|
83
|
+
...footer == null ? {} : { footer }
|
|
84
|
+
}, origin);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
exports.collectCommandDocMetadata = collectCommandDocMetadata;
|
|
89
|
+
exports.getCommandDocMetadata = getCommandDocMetadata;
|
|
90
|
+
exports.withCommandDocMetadata = withCommandDocMetadata;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//#region src/internal/command-doc-metadata.ts
|
|
2
|
+
function withOrigin(metadata, origin) {
|
|
3
|
+
const result = { ...metadata };
|
|
4
|
+
Object.defineProperty(result, "origin", {
|
|
5
|
+
value: origin,
|
|
6
|
+
enumerable: false
|
|
7
|
+
});
|
|
8
|
+
return result;
|
|
9
|
+
}
|
|
10
|
+
const commandDocMetadata = Symbol.for("@optique/core/commandDocMetadata");
|
|
11
|
+
const commandDocCarrier = Symbol.for("@optique/core/commandDocMetadataCarrier");
|
|
12
|
+
/**
|
|
13
|
+
* Reads effective page metadata, including custom collection-level fields.
|
|
14
|
+
* @param docs The child's documentation.
|
|
15
|
+
* @returns Its selected-command metadata, if any.
|
|
16
|
+
*/
|
|
17
|
+
function getCommandDocMetadata(docs) {
|
|
18
|
+
const carrier = docs.fragments[commandDocCarrier];
|
|
19
|
+
if (carrier != null) {
|
|
20
|
+
const brief = docs.brief === carrier.brief ? carrier.metadata.brief : docs.brief;
|
|
21
|
+
const origin = carrier.metadata.origin ?? "entry";
|
|
22
|
+
const customPage = origin === "entry" && (docs.brief !== carrier.brief || docs.footer !== carrier.footer);
|
|
23
|
+
const description = origin === "entry" && !customPage || docs.description === carrier.description ? carrier.metadata.description : docs.description;
|
|
24
|
+
const footer = docs.footer === carrier.footer ? carrier.metadata.footer : docs.footer;
|
|
25
|
+
return withOrigin({
|
|
26
|
+
...brief == null ? {} : { brief },
|
|
27
|
+
...description == null ? {} : { description },
|
|
28
|
+
...footer == null ? {} : { footer }
|
|
29
|
+
}, customPage ? "custom" : origin);
|
|
30
|
+
}
|
|
31
|
+
const metadata = docs[commandDocMetadata];
|
|
32
|
+
if (metadata != null) return metadata;
|
|
33
|
+
return docs.brief != null || docs.description != null || docs.footer != null ? withOrigin({
|
|
34
|
+
brief: docs.brief,
|
|
35
|
+
description: docs.description,
|
|
36
|
+
footer: docs.footer
|
|
37
|
+
}, "custom") : void 0;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Preserves selected-command metadata when rebuilding documentation fragments.
|
|
41
|
+
* @param docs The rebuilt documentation.
|
|
42
|
+
* @param metadata The selected-command metadata to preserve.
|
|
43
|
+
* @returns Documentation with the internal metadata attached.
|
|
44
|
+
*/
|
|
45
|
+
function withCommandDocMetadata(docs, metadata) {
|
|
46
|
+
if (metadata == null) return docs;
|
|
47
|
+
metadata = withOrigin(metadata, metadata.origin ?? "entry");
|
|
48
|
+
const fragments = [...docs.fragments];
|
|
49
|
+
Object.defineProperty(fragments, commandDocCarrier, { value: {
|
|
50
|
+
metadata,
|
|
51
|
+
brief: docs.brief,
|
|
52
|
+
description: docs.description,
|
|
53
|
+
footer: docs.footer
|
|
54
|
+
} });
|
|
55
|
+
const result = {
|
|
56
|
+
...docs,
|
|
57
|
+
fragments
|
|
58
|
+
};
|
|
59
|
+
Object.defineProperty(result, commandDocMetadata, { value: metadata });
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Collects selected-command metadata in documentation traversal order.
|
|
64
|
+
* @param current Metadata from earlier children.
|
|
65
|
+
* @param docs The next child's documentation.
|
|
66
|
+
* @param includeCustom Whether to retain custom page fields inside merge().
|
|
67
|
+
* @returns The first defined value from children with the same origin.
|
|
68
|
+
*/
|
|
69
|
+
function collectCommandDocMetadata(current, docs, includeCustom = false) {
|
|
70
|
+
const next = getCommandDocMetadata(docs);
|
|
71
|
+
if (next == null) return current;
|
|
72
|
+
const origin = next.origin ?? "entry";
|
|
73
|
+
if (origin === "entry" || origin === "custom" && !includeCustom) return current ?? withOrigin({}, "entry");
|
|
74
|
+
if (current?.origin === "command" && origin !== "command") return current;
|
|
75
|
+
if (current?.origin !== origin) current = void 0;
|
|
76
|
+
const brief = current?.brief ?? next.brief;
|
|
77
|
+
const description = current?.description ?? next.description;
|
|
78
|
+
const footer = current?.footer ?? next.footer;
|
|
79
|
+
return withOrigin({
|
|
80
|
+
...brief == null ? {} : { brief },
|
|
81
|
+
...description == null ? {} : { description },
|
|
82
|
+
...footer == null ? {} : { footer }
|
|
83
|
+
}, origin);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
export { collectCommandDocMetadata, getCommandDocMetadata, withCommandDocMetadata };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/internal/help-request.ts
|
|
3
|
+
/** Internal help request bridge; not a stable extension API. @module */
|
|
4
|
+
const helpRequestKey = Symbol.for("@optique/core/internal/help-request");
|
|
5
|
+
/**
|
|
6
|
+
* Copies options with a help target independent of help entry-point names.
|
|
7
|
+
* @param options The runner options to copy.
|
|
8
|
+
* @param commands The canonical command path to display.
|
|
9
|
+
* @returns Options carrying the internal request through transparent spreads.
|
|
10
|
+
* @internal
|
|
11
|
+
* @since 1.4.0
|
|
12
|
+
*/
|
|
13
|
+
function withHelpRequest(options, commands) {
|
|
14
|
+
return {
|
|
15
|
+
...options,
|
|
16
|
+
[helpRequestKey]: [...commands]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Reads an internal help target, including the empty root path.
|
|
21
|
+
* @param options The runner options.
|
|
22
|
+
* @returns The requested path, or undefined when no request exists.
|
|
23
|
+
* @internal
|
|
24
|
+
* @since 1.4.0
|
|
25
|
+
*/
|
|
26
|
+
function getHelpRequest(options) {
|
|
27
|
+
const value = Reflect.get(options, helpRequestKey);
|
|
28
|
+
return Array.isArray(value) && value.every((part) => typeof part === "string") ? value : void 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.getHelpRequest = getHelpRequest;
|
|
33
|
+
exports.withHelpRequest = withHelpRequest;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/internal/help-request.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Copies options with a help target independent of help entry-point names.
|
|
4
|
+
* @param options The runner options to copy.
|
|
5
|
+
* @param commands The canonical command path to display.
|
|
6
|
+
* @returns Options carrying the internal request through transparent spreads.
|
|
7
|
+
* @internal
|
|
8
|
+
* @since 1.4.0
|
|
9
|
+
*/
|
|
10
|
+
declare function withHelpRequest<T extends object>(options: T, commands: readonly string[]): T;
|
|
11
|
+
/**
|
|
12
|
+
* Reads an internal help target, including the empty root path.
|
|
13
|
+
* @param options The runner options.
|
|
14
|
+
* @returns The requested path, or undefined when no request exists.
|
|
15
|
+
* @internal
|
|
16
|
+
* @since 1.4.0
|
|
17
|
+
*/
|
|
18
|
+
declare function getHelpRequest(options: object): readonly string[] | undefined;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { getHelpRequest, withHelpRequest };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/internal/help-request.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Copies options with a help target independent of help entry-point names.
|
|
4
|
+
* @param options The runner options to copy.
|
|
5
|
+
* @param commands The canonical command path to display.
|
|
6
|
+
* @returns Options carrying the internal request through transparent spreads.
|
|
7
|
+
* @internal
|
|
8
|
+
* @since 1.4.0
|
|
9
|
+
*/
|
|
10
|
+
declare function withHelpRequest<T extends object>(options: T, commands: readonly string[]): T;
|
|
11
|
+
/**
|
|
12
|
+
* Reads an internal help target, including the empty root path.
|
|
13
|
+
* @param options The runner options.
|
|
14
|
+
* @returns The requested path, or undefined when no request exists.
|
|
15
|
+
* @internal
|
|
16
|
+
* @since 1.4.0
|
|
17
|
+
*/
|
|
18
|
+
declare function getHelpRequest(options: object): readonly string[] | undefined;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { getHelpRequest, withHelpRequest };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/internal/help-request.ts
|
|
2
|
+
/** Internal help request bridge; not a stable extension API. @module */
|
|
3
|
+
const helpRequestKey = Symbol.for("@optique/core/internal/help-request");
|
|
4
|
+
/**
|
|
5
|
+
* Copies options with a help target independent of help entry-point names.
|
|
6
|
+
* @param options The runner options to copy.
|
|
7
|
+
* @param commands The canonical command path to display.
|
|
8
|
+
* @returns Options carrying the internal request through transparent spreads.
|
|
9
|
+
* @internal
|
|
10
|
+
* @since 1.4.0
|
|
11
|
+
*/
|
|
12
|
+
function withHelpRequest(options, commands) {
|
|
13
|
+
return {
|
|
14
|
+
...options,
|
|
15
|
+
[helpRequestKey]: [...commands]
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Reads an internal help target, including the empty root path.
|
|
20
|
+
* @param options The runner options.
|
|
21
|
+
* @returns The requested path, or undefined when no request exists.
|
|
22
|
+
* @internal
|
|
23
|
+
* @since 1.4.0
|
|
24
|
+
*/
|
|
25
|
+
function getHelpRequest(options) {
|
|
26
|
+
const value = Reflect.get(options, helpRequestKey);
|
|
27
|
+
return Array.isArray(value) && value.every((part) => typeof part === "string") ? value : void 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { getHelpRequest, withHelpRequest };
|
package/dist/modifiers.cjs
CHANGED
|
@@ -7,6 +7,7 @@ const require_annotation_state = require('./annotation-state.cjs');
|
|
|
7
7
|
const require_empty_input = require('./internal/empty-input.cjs');
|
|
8
8
|
const require_execution_context = require('./execution-context.cjs');
|
|
9
9
|
const require_short_option = require('./short-option.cjs');
|
|
10
|
+
const require_command_doc_metadata = require('./internal/command-doc-metadata.cjs');
|
|
10
11
|
const require_passthrough = require('./internal/passthrough.cjs');
|
|
11
12
|
const require_phase2_seed = require('./phase2-seed.cjs');
|
|
12
13
|
const require_dependency_metadata = require('./dependency-metadata.cjs');
|
|
@@ -667,10 +668,10 @@ function withDefault(parser, defaultValue, options) {
|
|
|
667
668
|
};
|
|
668
669
|
return fragment;
|
|
669
670
|
});
|
|
670
|
-
return {
|
|
671
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
671
672
|
...fragments,
|
|
672
673
|
fragments: modifiedFragments
|
|
673
|
-
};
|
|
674
|
+
}, require_command_doc_metadata.getCommandDocMetadata(fragments));
|
|
674
675
|
}
|
|
675
676
|
return fragments;
|
|
676
677
|
}
|
package/dist/modifiers.js
CHANGED
|
@@ -7,6 +7,7 @@ import { getDelegatedAnnotationState, hasDelegatedAnnotationCarrier, isAnnotatio
|
|
|
7
7
|
import { acceptsEmptyInput, defineEmptyInputFacts, getEmptyInputFacts, multipleFacts, optionalLikeFacts, resolveEmptyStepState } from "./internal/empty-input.js";
|
|
8
8
|
import { mergeChildExec, withChildContext, withChildExecPath } from "./execution-context.js";
|
|
9
9
|
import { combinedOptionScope, repeatedOptionScope, scopeParser } from "./short-option.js";
|
|
10
|
+
import { getCommandDocMetadata, withCommandDocMetadata } from "./internal/command-doc-metadata.js";
|
|
10
11
|
import { defineKnownCompletionLookup, defineReachableChildren, getKnownCompletion } from "./internal/passthrough.js";
|
|
11
12
|
import { completeOrExtractPhase2Seed, extractPhase2Seed, extractPhase2SeedKey, phase2SeedFromValueResult } from "./phase2-seed.js";
|
|
12
13
|
import { composeDependencyMetadata } from "./dependency-metadata.js";
|
|
@@ -667,10 +668,10 @@ function withDefault(parser, defaultValue, options) {
|
|
|
667
668
|
};
|
|
668
669
|
return fragment;
|
|
669
670
|
});
|
|
670
|
-
return {
|
|
671
|
+
return withCommandDocMetadata({
|
|
671
672
|
...fragments,
|
|
672
673
|
fragments: modifiedFragments
|
|
673
|
-
};
|
|
674
|
+
}, getCommandDocMetadata(fragments));
|
|
674
675
|
}
|
|
675
676
|
return fragments;
|
|
676
677
|
}
|
package/dist/primitives.cjs
CHANGED
|
@@ -11,6 +11,7 @@ const require_empty_input = require('./internal/empty-input.cjs');
|
|
|
11
11
|
const require_execution_context = require('./execution-context.cjs');
|
|
12
12
|
const require_usage_internals = require('./usage-internals.cjs');
|
|
13
13
|
const require_short_option = require('./short-option.cjs');
|
|
14
|
+
const require_command_doc_metadata = require('./internal/command-doc-metadata.cjs');
|
|
14
15
|
const require_passthrough = require('./internal/passthrough.cjs');
|
|
15
16
|
const require_command_alias = require('./internal/command-alias.cjs');
|
|
16
17
|
const require_failure = require('./internal/failure.cjs');
|
|
@@ -695,10 +696,10 @@ function option(...args) {
|
|
|
695
696
|
return suggestOptionSync(optionNames$1, valueParser, require_usage.isSuggestionHidden(options.hidden), options.description, context, prefix);
|
|
696
697
|
},
|
|
697
698
|
getDocFragments(_state, defaultValue) {
|
|
698
|
-
if (require_usage.isDocHidden(options.hidden)) return {
|
|
699
|
+
if (require_usage.isDocHidden(options.hidden)) return require_command_doc_metadata.withCommandDocMetadata({
|
|
699
700
|
fragments: [],
|
|
700
701
|
description: options.description
|
|
701
|
-
};
|
|
702
|
+
}, {});
|
|
702
703
|
const choicesMessage = valueParser?.choices != null && valueParser.choices.length > 0 ? require_message.valueSet(valueParser.choices.map((c) => valueParser.format(c)), {
|
|
703
704
|
fallback: "",
|
|
704
705
|
type: "unit"
|
|
@@ -714,10 +715,10 @@ function option(...args) {
|
|
|
714
715
|
default: defaultValue != null && valueParser != null ? require_message.message`${valueParser.format(defaultValue)}` : void 0,
|
|
715
716
|
choices: choicesMessage
|
|
716
717
|
}];
|
|
717
|
-
return {
|
|
718
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
718
719
|
fragments,
|
|
719
720
|
description: options.description
|
|
720
|
-
};
|
|
721
|
+
}, {});
|
|
721
722
|
},
|
|
722
723
|
[Symbol.for("Deno.customInspect")]() {
|
|
723
724
|
return `option(${optionNames$1.map((o) => JSON.stringify(o)).join(", ")})`;
|
|
@@ -967,10 +968,10 @@ function flag(...args) {
|
|
|
967
968
|
return suggestions;
|
|
968
969
|
},
|
|
969
970
|
getDocFragments(_state, _defaultValue) {
|
|
970
|
-
if (require_usage.isDocHidden(options.hidden)) return {
|
|
971
|
+
if (require_usage.isDocHidden(options.hidden)) return require_command_doc_metadata.withCommandDocMetadata({
|
|
971
972
|
fragments: [],
|
|
972
973
|
description: options.description
|
|
973
|
-
};
|
|
974
|
+
}, {});
|
|
974
975
|
const fragments = [{
|
|
975
976
|
type: "entry",
|
|
976
977
|
term: {
|
|
@@ -979,10 +980,10 @@ function flag(...args) {
|
|
|
979
980
|
},
|
|
980
981
|
description: options.description
|
|
981
982
|
}];
|
|
982
|
-
return {
|
|
983
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
983
984
|
fragments,
|
|
984
985
|
description: options.description
|
|
985
|
-
};
|
|
986
|
+
}, {});
|
|
986
987
|
},
|
|
987
988
|
[Symbol.for("Deno.customInspect")]() {
|
|
988
989
|
return `flag(${optionNames$1.map((o) => JSON.stringify(o)).join(", ")})`;
|
|
@@ -1324,10 +1325,10 @@ function argument(valueParser, options = {}) {
|
|
|
1324
1325
|
return suggestArgumentSync(valueParser, require_usage.isSuggestionHidden(options.hidden), prefix, context.dependencyRegistry, context.exec);
|
|
1325
1326
|
},
|
|
1326
1327
|
getDocFragments(_state, defaultValue) {
|
|
1327
|
-
if (require_usage.isDocHidden(options.hidden)) return {
|
|
1328
|
+
if (require_usage.isDocHidden(options.hidden)) return require_command_doc_metadata.withCommandDocMetadata({
|
|
1328
1329
|
fragments: [],
|
|
1329
1330
|
description: options.description
|
|
1330
|
-
};
|
|
1331
|
+
}, {});
|
|
1331
1332
|
const choicesMessage = valueParser.choices != null && valueParser.choices.length > 0 ? require_message.valueSet(valueParser.choices.map((c) => valueParser.format(c)), {
|
|
1332
1333
|
fallback: "",
|
|
1333
1334
|
type: "unit"
|
|
@@ -1339,10 +1340,10 @@ function argument(valueParser, options = {}) {
|
|
|
1339
1340
|
default: defaultValue == null ? void 0 : require_message.message`${valueParser.format(defaultValue)}`,
|
|
1340
1341
|
choices: choicesMessage
|
|
1341
1342
|
}];
|
|
1342
|
-
return {
|
|
1343
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
1343
1344
|
fragments,
|
|
1344
1345
|
description: options.description
|
|
1345
|
-
};
|
|
1346
|
+
}, {});
|
|
1346
1347
|
},
|
|
1347
1348
|
[Symbol.for("Deno.customInspect")]() {
|
|
1348
1349
|
return `argument()`;
|
|
@@ -1723,11 +1724,11 @@ function command(name, parser, options = {}) {
|
|
|
1723
1724
|
getDocFragments(state, defaultValue) {
|
|
1724
1725
|
const commandState = state.kind === "available" ? normalizeCommandState(state.state) : void 0;
|
|
1725
1726
|
if (state.kind === "unavailable" || typeof commandState === "undefined") {
|
|
1726
|
-
if (require_usage.isDocHidden(options.hidden)) return {
|
|
1727
|
+
if (require_usage.isDocHidden(options.hidden)) return require_command_doc_metadata.withCommandDocMetadata({
|
|
1727
1728
|
fragments: [],
|
|
1728
1729
|
description: options.description
|
|
1729
|
-
};
|
|
1730
|
-
return {
|
|
1730
|
+
}, {});
|
|
1731
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
1731
1732
|
description: options.description,
|
|
1732
1733
|
fragments: [{
|
|
1733
1734
|
type: "entry",
|
|
@@ -1739,7 +1740,7 @@ function command(name, parser, options = {}) {
|
|
|
1739
1740
|
description: options.brief ?? options.description,
|
|
1740
1741
|
...showAliases != null && { showAliases }
|
|
1741
1742
|
}]
|
|
1742
|
-
};
|
|
1743
|
+
}, {});
|
|
1743
1744
|
}
|
|
1744
1745
|
const innerState = commandState[0] === "parsing" ? {
|
|
1745
1746
|
kind: "available",
|
|
@@ -1749,12 +1750,18 @@ function command(name, parser, options = {}) {
|
|
|
1749
1750
|
state: getCommandChildState(state.state, parser.initialState, parser)
|
|
1750
1751
|
};
|
|
1751
1752
|
const innerFragments = parser.getDocFragments(innerState, defaultValue);
|
|
1752
|
-
|
|
1753
|
+
const innerMetadata = require_command_doc_metadata.getCommandDocMetadata(innerFragments) ?? innerFragments;
|
|
1754
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
1753
1755
|
...innerFragments,
|
|
1754
1756
|
brief: innerFragments.brief ?? options.brief,
|
|
1755
1757
|
description: innerFragments.description ?? options.description,
|
|
1756
1758
|
footer: innerFragments.footer ?? options.footer
|
|
1757
|
-
}
|
|
1759
|
+
}, {
|
|
1760
|
+
origin: "command",
|
|
1761
|
+
brief: innerMetadata?.brief ?? options.brief,
|
|
1762
|
+
description: innerMetadata?.description ?? options.description,
|
|
1763
|
+
footer: innerMetadata?.footer ?? options.footer
|
|
1764
|
+
});
|
|
1758
1765
|
},
|
|
1759
1766
|
[Symbol.for("Deno.customInspect")]() {
|
|
1760
1767
|
return `command(${JSON.stringify(name)})`;
|
|
@@ -1972,18 +1979,18 @@ function passThrough(options = {}) {
|
|
|
1972
1979
|
return [];
|
|
1973
1980
|
},
|
|
1974
1981
|
getDocFragments(_state, _defaultValue) {
|
|
1975
|
-
if (require_usage.isDocHidden(options.hidden)) return {
|
|
1982
|
+
if (require_usage.isDocHidden(options.hidden)) return require_command_doc_metadata.withCommandDocMetadata({
|
|
1976
1983
|
fragments: [],
|
|
1977
1984
|
description: options.description
|
|
1978
|
-
};
|
|
1979
|
-
return {
|
|
1985
|
+
}, {});
|
|
1986
|
+
return require_command_doc_metadata.withCommandDocMetadata({
|
|
1980
1987
|
fragments: [{
|
|
1981
1988
|
type: "entry",
|
|
1982
1989
|
term: { type: "passthrough" },
|
|
1983
1990
|
description: options.description
|
|
1984
1991
|
}],
|
|
1985
1992
|
description: options.description
|
|
1986
|
-
};
|
|
1993
|
+
}, {});
|
|
1987
1994
|
},
|
|
1988
1995
|
[Symbol.for("Deno.customInspect")]() {
|
|
1989
1996
|
return `passThrough(${format})`;
|
package/dist/primitives.js
CHANGED
|
@@ -11,6 +11,7 @@ import { UNCHANGED, defineEmptyInputFacts, failingStepFacts } from "./internal/e
|
|
|
11
11
|
import { mergeChildExec, withChildContext, withChildExecPath } from "./execution-context.js";
|
|
12
12
|
import { extractLeadingCommandNames } from "./usage-internals.js";
|
|
13
13
|
import { attachedValuePrefix, combinedOptionScope, fullNameOwnsToken, prefixSuggestion, scopeParser, selectableOptionScope } from "./short-option.js";
|
|
14
|
+
import { getCommandDocMetadata, withCommandDocMetadata } from "./internal/command-doc-metadata.js";
|
|
14
15
|
import { defineKnownCompletion, definePassThroughPriority, defineReachableChildren, getPassThroughFailure } from "./internal/passthrough.js";
|
|
15
16
|
import { hiddenCommandAliasesKey } from "./internal/command-alias.js";
|
|
16
17
|
import { createDeferredFailure } from "./internal/failure.js";
|
|
@@ -695,10 +696,10 @@ function option(...args) {
|
|
|
695
696
|
return suggestOptionSync(optionNames$1, valueParser, isSuggestionHidden(options.hidden), options.description, context, prefix);
|
|
696
697
|
},
|
|
697
698
|
getDocFragments(_state, defaultValue) {
|
|
698
|
-
if (isDocHidden(options.hidden)) return {
|
|
699
|
+
if (isDocHidden(options.hidden)) return withCommandDocMetadata({
|
|
699
700
|
fragments: [],
|
|
700
701
|
description: options.description
|
|
701
|
-
};
|
|
702
|
+
}, {});
|
|
702
703
|
const choicesMessage = valueParser?.choices != null && valueParser.choices.length > 0 ? valueSet(valueParser.choices.map((c) => valueParser.format(c)), {
|
|
703
704
|
fallback: "",
|
|
704
705
|
type: "unit"
|
|
@@ -714,10 +715,10 @@ function option(...args) {
|
|
|
714
715
|
default: defaultValue != null && valueParser != null ? message`${valueParser.format(defaultValue)}` : void 0,
|
|
715
716
|
choices: choicesMessage
|
|
716
717
|
}];
|
|
717
|
-
return {
|
|
718
|
+
return withCommandDocMetadata({
|
|
718
719
|
fragments,
|
|
719
720
|
description: options.description
|
|
720
|
-
};
|
|
721
|
+
}, {});
|
|
721
722
|
},
|
|
722
723
|
[Symbol.for("Deno.customInspect")]() {
|
|
723
724
|
return `option(${optionNames$1.map((o) => JSON.stringify(o)).join(", ")})`;
|
|
@@ -967,10 +968,10 @@ function flag(...args) {
|
|
|
967
968
|
return suggestions;
|
|
968
969
|
},
|
|
969
970
|
getDocFragments(_state, _defaultValue) {
|
|
970
|
-
if (isDocHidden(options.hidden)) return {
|
|
971
|
+
if (isDocHidden(options.hidden)) return withCommandDocMetadata({
|
|
971
972
|
fragments: [],
|
|
972
973
|
description: options.description
|
|
973
|
-
};
|
|
974
|
+
}, {});
|
|
974
975
|
const fragments = [{
|
|
975
976
|
type: "entry",
|
|
976
977
|
term: {
|
|
@@ -979,10 +980,10 @@ function flag(...args) {
|
|
|
979
980
|
},
|
|
980
981
|
description: options.description
|
|
981
982
|
}];
|
|
982
|
-
return {
|
|
983
|
+
return withCommandDocMetadata({
|
|
983
984
|
fragments,
|
|
984
985
|
description: options.description
|
|
985
|
-
};
|
|
986
|
+
}, {});
|
|
986
987
|
},
|
|
987
988
|
[Symbol.for("Deno.customInspect")]() {
|
|
988
989
|
return `flag(${optionNames$1.map((o) => JSON.stringify(o)).join(", ")})`;
|
|
@@ -1324,10 +1325,10 @@ function argument(valueParser, options = {}) {
|
|
|
1324
1325
|
return suggestArgumentSync(valueParser, isSuggestionHidden(options.hidden), prefix, context.dependencyRegistry, context.exec);
|
|
1325
1326
|
},
|
|
1326
1327
|
getDocFragments(_state, defaultValue) {
|
|
1327
|
-
if (isDocHidden(options.hidden)) return {
|
|
1328
|
+
if (isDocHidden(options.hidden)) return withCommandDocMetadata({
|
|
1328
1329
|
fragments: [],
|
|
1329
1330
|
description: options.description
|
|
1330
|
-
};
|
|
1331
|
+
}, {});
|
|
1331
1332
|
const choicesMessage = valueParser.choices != null && valueParser.choices.length > 0 ? valueSet(valueParser.choices.map((c) => valueParser.format(c)), {
|
|
1332
1333
|
fallback: "",
|
|
1333
1334
|
type: "unit"
|
|
@@ -1339,10 +1340,10 @@ function argument(valueParser, options = {}) {
|
|
|
1339
1340
|
default: defaultValue == null ? void 0 : message`${valueParser.format(defaultValue)}`,
|
|
1340
1341
|
choices: choicesMessage
|
|
1341
1342
|
}];
|
|
1342
|
-
return {
|
|
1343
|
+
return withCommandDocMetadata({
|
|
1343
1344
|
fragments,
|
|
1344
1345
|
description: options.description
|
|
1345
|
-
};
|
|
1346
|
+
}, {});
|
|
1346
1347
|
},
|
|
1347
1348
|
[Symbol.for("Deno.customInspect")]() {
|
|
1348
1349
|
return `argument()`;
|
|
@@ -1723,11 +1724,11 @@ function command(name, parser, options = {}) {
|
|
|
1723
1724
|
getDocFragments(state, defaultValue) {
|
|
1724
1725
|
const commandState = state.kind === "available" ? normalizeCommandState(state.state) : void 0;
|
|
1725
1726
|
if (state.kind === "unavailable" || typeof commandState === "undefined") {
|
|
1726
|
-
if (isDocHidden(options.hidden)) return {
|
|
1727
|
+
if (isDocHidden(options.hidden)) return withCommandDocMetadata({
|
|
1727
1728
|
fragments: [],
|
|
1728
1729
|
description: options.description
|
|
1729
|
-
};
|
|
1730
|
-
return {
|
|
1730
|
+
}, {});
|
|
1731
|
+
return withCommandDocMetadata({
|
|
1731
1732
|
description: options.description,
|
|
1732
1733
|
fragments: [{
|
|
1733
1734
|
type: "entry",
|
|
@@ -1739,7 +1740,7 @@ function command(name, parser, options = {}) {
|
|
|
1739
1740
|
description: options.brief ?? options.description,
|
|
1740
1741
|
...showAliases != null && { showAliases }
|
|
1741
1742
|
}]
|
|
1742
|
-
};
|
|
1743
|
+
}, {});
|
|
1743
1744
|
}
|
|
1744
1745
|
const innerState = commandState[0] === "parsing" ? {
|
|
1745
1746
|
kind: "available",
|
|
@@ -1749,12 +1750,18 @@ function command(name, parser, options = {}) {
|
|
|
1749
1750
|
state: getCommandChildState(state.state, parser.initialState, parser)
|
|
1750
1751
|
};
|
|
1751
1752
|
const innerFragments = parser.getDocFragments(innerState, defaultValue);
|
|
1752
|
-
|
|
1753
|
+
const innerMetadata = getCommandDocMetadata(innerFragments) ?? innerFragments;
|
|
1754
|
+
return withCommandDocMetadata({
|
|
1753
1755
|
...innerFragments,
|
|
1754
1756
|
brief: innerFragments.brief ?? options.brief,
|
|
1755
1757
|
description: innerFragments.description ?? options.description,
|
|
1756
1758
|
footer: innerFragments.footer ?? options.footer
|
|
1757
|
-
}
|
|
1759
|
+
}, {
|
|
1760
|
+
origin: "command",
|
|
1761
|
+
brief: innerMetadata?.brief ?? options.brief,
|
|
1762
|
+
description: innerMetadata?.description ?? options.description,
|
|
1763
|
+
footer: innerMetadata?.footer ?? options.footer
|
|
1764
|
+
});
|
|
1758
1765
|
},
|
|
1759
1766
|
[Symbol.for("Deno.customInspect")]() {
|
|
1760
1767
|
return `command(${JSON.stringify(name)})`;
|
|
@@ -1972,18 +1979,18 @@ function passThrough(options = {}) {
|
|
|
1972
1979
|
return [];
|
|
1973
1980
|
},
|
|
1974
1981
|
getDocFragments(_state, _defaultValue) {
|
|
1975
|
-
if (isDocHidden(options.hidden)) return {
|
|
1982
|
+
if (isDocHidden(options.hidden)) return withCommandDocMetadata({
|
|
1976
1983
|
fragments: [],
|
|
1977
1984
|
description: options.description
|
|
1978
|
-
};
|
|
1979
|
-
return {
|
|
1985
|
+
}, {});
|
|
1986
|
+
return withCommandDocMetadata({
|
|
1980
1987
|
fragments: [{
|
|
1981
1988
|
type: "entry",
|
|
1982
1989
|
term: { type: "passthrough" },
|
|
1983
1990
|
description: options.description
|
|
1984
1991
|
}],
|
|
1985
1992
|
description: options.description
|
|
1986
|
-
};
|
|
1993
|
+
}, {});
|
|
1987
1994
|
},
|
|
1988
1995
|
[Symbol.for("Deno.customInspect")]() {
|
|
1989
1996
|
return `passThrough(${format})`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/core",
|
|
3
|
-
"version": "1.4.0-dev.
|
|
3
|
+
"version": "1.4.0-dev.2749",
|
|
4
4
|
"description": "Type-safe combinatorial command-line interface parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -243,6 +243,14 @@
|
|
|
243
243
|
},
|
|
244
244
|
"import": "./dist/internal/command-doc-policy.js",
|
|
245
245
|
"require": "./dist/internal/command-doc-policy.cjs"
|
|
246
|
+
},
|
|
247
|
+
"./internal/help-request": {
|
|
248
|
+
"types": {
|
|
249
|
+
"import": "./dist/internal/help-request.d.ts",
|
|
250
|
+
"require": "./dist/internal/help-request.d.cts"
|
|
251
|
+
},
|
|
252
|
+
"import": "./dist/internal/help-request.js",
|
|
253
|
+
"require": "./dist/internal/help-request.cjs"
|
|
246
254
|
}
|
|
247
255
|
},
|
|
248
256
|
"imports": {
|
|
@@ -253,7 +261,7 @@
|
|
|
253
261
|
},
|
|
254
262
|
"sideEffects": false,
|
|
255
263
|
"devDependencies": {
|
|
256
|
-
"@optique/env": "1.4.0-dev.
|
|
264
|
+
"@optique/env": "1.4.0-dev.2749+6d558083",
|
|
257
265
|
"@types/node": "^24.0.0",
|
|
258
266
|
"fast-check": "^4.7.0",
|
|
259
267
|
"tsdown": "^0.13.0",
|
package/skills/optique/SKILL.md
CHANGED
|
@@ -295,5 +295,5 @@ Integration packages
|
|
|
295
295
|
| `@optique/git` | Async Git reference validation | <https://optique.dev/integrations/git.md> |
|
|
296
296
|
| `@optique/logtape` | LogTape levels and formatter/output options | <https://optique.dev/integrations/logtape.md> |
|
|
297
297
|
| `@optique/man` | Man page generation | <https://optique.dev/concepts/man.md> |
|
|
298
|
-
| `@optique/discover` |
|
|
298
|
+
| `@optique/discover` | Command discovery; opt-in `help.bareGroup` | <https://optique.dev/concepts/discover.md> |
|
|
299
299
|
| `@optique/testing` | Layered CLI testing at a chosen boundary | <https://optique.dev/concepts/testing.md> |
|