command.ts ×2
Frontier kind: Code frontier
unlabeled · c_e2769b5b5aa4
55 tests · 2004 LOC · 18 files · introduces 0 tests · 13 LOC · 1 file
Introduces — evidence that enters the hierarchy at this concept
Code
2 ranges 13 lines · 1 files
Tests
0 tests
Contains — complete concept membership
Neighbourhood graph
The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.
Focus concept
Ancestors (broader)
Descendants (narrower)
Introduced files
Introduced tests
Introduced files, introduced tests, and structurally relevant concept specialization
In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.
Graph controls are ready.
Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.
JavaScript is disabled; use the native relationship evidence on this page to explore the same evidence.
Native relationship evidence
Every exact file and test below is linked only from the concept that introduces it.
command.ts ×2 — Focused concept
Introduced files:
command.mjs|title=Command positional arguments does not combine positional default and provided values|occurrence=1 — Ancestor (broader)
Introduced tests:
usage.mjs|title=usage tests with strict() option set should wrap whitespace in quotes if provided as an unknown argument|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command positional arguments does not overwrite options in argv if variadic|occurrence=1 — Ancestor (broader)
Introduced tests:
usage.mjs|title=usage tests default command should display help output for nested default command on failure|occurrence=1 — Ancestor (broader)
Introduced tests:
yargs-factory.ts ×1 — Ancestor (broader)
Introduced files:
Introduced tests:
yargs.mjs|title=yargs dsl tests command accepts a module with a keys 'command', 'describe', 'builder', and 'handler'|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command help command displays command help appropriately|occurrence=1 — Ancestor (broader)
Introduced tests:
usage.mjs|title=usage tests usage for default command positional should contain the expected output for showHelp|occurrence=1 — Ancestor (broader)
Introduced tests:
string|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command async builder allows deeply nested command to be defined in async builder|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command async builder allows command to be defined in async builder|occurrence=1 — Ancestor (broader)
Introduced tests:
yargs-test.mjs|title=ESM hierarchy of commands allows array of commands to be registered|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command allows an array of commands to be provided|occurrence=1, yargs-test.mjs|title=ESM hierarchy of commands allows array of subcommands to be registered|occurrence=1 — Ancestor (broader)
Introduced tests:
command.ts ×1 — Ancestor (broader)
Introduced files:
Introduced tests:
usage.mjs|title=usage tests default command should display options (with descriptions) on failed default command|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command commandDir supports nested subcommands|occurrence=1 — Ancestor (broader)
Introduced tests:
usage.mjs|title=usage tests usage for default command multiple should contain the expected output for getHelp when called from within handler|occurrence=1 — Ancestor (broader)
Introduced tests:
usage.mjs|title=usage tests usage for default command multiple should contain the expected output for showHelp when called from within handler|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command positional arguments does not overwrite options in argv if variadic and preserves falsy values|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command positional arguments does not overwrite options in argv if variadic and when using default command|occurrence=1 — Ancestor (broader)
Introduced tests:
command.ts ×2 — Ancestor (broader)
Introduced files:
completion.mjs|title=Completion default completion behavior calling yargs(--get-yargs-completions, …) completes choices for nested command|occurrence=1 — Ancestor (broader)
Introduced tests:
usage.mjs|title=usage tests async builder positional should contain the expected output for --help|occurrence=1 — Ancestor (broader)
Introduced tests:
usage.mjs|title=usage tests usage for default command positional should contain the expected output for --help|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command commandDir allows ESM modules commands to be extensible using visit option|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command commandDir allows commands files to be written as ESM modules|occurrence=1 — Ancestor (broader)
Introduced tests:
completion.mjs|title=Completion default completion behavior calling yargs(--get-yargs-completions, …) works if positional has no choices|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command commandDir detects and ignores cyclic dir references|occurrence=1 — Ancestor (broader)
Introduced tests:
usage.mjs|title=usage tests usage for default command multiple should contain the expected output for --help|occurrence=1 — Ancestor (broader)
Introduced tests:
completion, --get-yargs-completions, …) completes choices for nested command|occurrence=1 — Ancestor (broader)
Introduced tests:
completion, --get-yargs-completions, …) works if positional has no choices|occurrence=1 — Ancestor (broader)
Introduced tests:
command.ts ×1 — Ancestor (broader)
Introduced files:
Introduced tests:
command.ts ×1 — Ancestor (broader)
Introduced files:
Introduced tests:
command.ts ×1 — Ancestor (broader)
Introduced files:
Introduced tests:
command.ts ×1 — Ancestor (broader)
Introduced files:
Introduced tests:
command.ts ×3 — Ancestor (broader)
Introduced files:
command.ts ×3 — Ancestor (broader)
Introduced files:
command.ts ×1 — Ancestor (broader)
Introduced files:
Introduced tests:
command.mjs|title=Command commandDir supports absolute dirs|occurrence=1, command.mjs|title=Command commandDir supports relative dirs|occurrence=1, +1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command deprecated command using module shows deprecated notice with boolean|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command deprecated command using module shows deprecated notice with string|occurrence=1 — Ancestor (broader)
Introduced tests:
usage.mjs|title=usage tests usage for default command multiple should contain the expected output for showHelp|occurrence=1 — Ancestor (broader)
Introduced tests:
usage.mjs|title=usage tests usage for default command multiple should contain the expected output for getHelp|occurrence=1 — Ancestor (broader)
Introduced tests:
command.ts ×2 — Ancestor (broader)
Introduced files:
yargs-factory.ts ×1 — Ancestor (broader)
Introduced files:
command.ts ×1 — Ancestor (broader)
Introduced files:
yargs.mjs|title=yargs dsl tests locale does not enter infinite loop when locale is invalid|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command API accepts module (with command array) as 1st argument|occurrence=1, command.mjs|title=Command API accepts module (with command array and aliases array) as 1st argument|occurrence=1, +2 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command API accepts module (desc key, builder function) as 1st argument|occurrence=1, command.mjs|title=Command API accepts module (description key, builder function) as 1st argument|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command API accepts module (missing handler function) as 1st argument|occurrence=1, command.mjs|title=Command API accepts module (describe key, builder object) as 1st argument|occurrence=1, +1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command API accepts module (missing describe, builder function) as 1st argument|occurrence=1 — Ancestor (broader)
Introduced tests:
command.mjs|title=Command API accepts module (false describe, builder function) as 1st argument|occurrence=1 — Ancestor (broader)
Introduced tests:
command.ts ×1 — Ancestor (broader)
Introduced files:
command.ts ×1 — Ancestor (broader)
Introduced files:
command.ts ×1 — Descendant (narrower)
Introduced files:
command.ts ×5 — Descendant (narrower)
Introduced files:
command.ts ×1 — Descendant (narrower)
Introduced files:
command.ts ×1 — Descendant (narrower)
Introduced files:
command.ts ×3 — Descendant (narrower)
Introduced files:
yargs-factory.ts ×1 — Descendant (narrower)
Introduced files:
yargs-factory.ts ×35 — Descendant (narrower)
Introduced files:
yargs-factory.ts ×124 — Descendant (narrower)
Introduced files:
Introduced tests:
argsert.ts ×1 — Descendant (narrower)
Introduced files:
Introduced tests:
argsert.mjs|title=Argsert allows for any type if * is provided|occurrence=1, argsert.mjs|title=Argsert should ignore trailing undefined values|occurrence=1 — Descendant (narrower)
Introduced tests:
argsert.ts ×1 — Descendant (narrower)
Introduced files:
argsert.ts ×1 — Descendant (narrower)
Introduced files:
argsert.ts ×1 — Descendant (narrower)
Introduced files:
argsert.ts ×1 — Descendant (narrower)
Introduced files:
argsert.ts ×1 — Descendant (narrower)
Introduced files:
Introduced tests:
argsert.ts ×2 — Descendant (narrower)
Introduced files:
argsert.ts ×3 — Descendant (narrower)
Introduced files:
parse-command.ts ×1 — Descendant (narrower)
Introduced files:
parse-command.ts ×1 — Descendant (narrower)
Introduced files:
parse-command.ts ×3 — Descendant (narrower)
Introduced files:
process-argv.ts ×1 — Descendant (narrower)
Introduced files:
process-argv.ts ×3 — Descendant (narrower)
Introduced files:
argsert.ts ×1 — Descendant (narrower)
Introduced files:
apply-extends.ts ×4 — Descendant (narrower)
Introduced files:
Introduced tests:
argsert.ts ×4 — Descendant (narrower)
Introduced files:
obj-filter.ts ×2 — Descendant (narrower)
Introduced files:
argsert.ts ×3 — Descendant (narrower)
Introduced files:
common-types.ts ×4 — Descendant (narrower)
Introduced files:
process-argv.ts ×5 — Descendant (narrower)
Introduced files:
Introduced tests:
parse-command.ts ×1 — Descendant (narrower)
Introduced files:
Introduced tests:
parse-command.ts ×2 — Descendant (narrower)
Introduced files:
yerror.ts ×2 — Descendant (narrower)
Introduced files:
is-promise.ts ×1 — Descendant (narrower)
Introduced files:
Introduced tests
Every collected test enters the hierarchy at exactly one concept.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Introduced code
Every collected source range enters the hierarchy at exactly one concept.
1 file ranked by introduced lines: 13 introduced LOC across 2 ranges.
Expand a file to inspect source; the > gutter marks introduced lines.
lib/command.ts 13 introduced LOC · 2 ranges
Open complete file
155
);
156
}
158
>
command = ([] as string []). concat ( command ). concat ( cmd . aliases );
159
>
this . addHandler (
160
>
command ,
161
>
this . extractDesc ( cmd ),
162
>
cmd . builder ,
163
>
cmd . handler ,
164
>
cmd . middlewares ,
165
>
cmd . deprecated
166
>
);
167
>
return ;
168
} else if ( isCommandBuilderDefinition ( builder )) {
169
// Allow a module to be provided as builder, rather than function:
749
750
private extractDesc ({ describe , description , desc } : CommandHandlerDefinition ) {
751
>
for ( const test of [ describe , description , desc ]) {
command.ts
752
>
if ( typeof test === 'string' || test === false ) return test ;
753
assertNotStrictEqual ( test , true as const , this . shim );
754
}