@oclif/core 4.5.6-autocomplete.0 → 4.5.6
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/lib/help/command.js
CHANGED
|
@@ -58,7 +58,8 @@ class CommandHelp extends formatter_1.HelpFormatter {
|
|
|
58
58
|
return;
|
|
59
59
|
return args.map((a) => {
|
|
60
60
|
// Add ellipsis to indicate that the argument takes multiple values if strict is false
|
|
61
|
-
|
|
61
|
+
let name = this.command.strict === false ? `${a.name.toUpperCase()}...` : a.name.toUpperCase();
|
|
62
|
+
name = a.required ? `${name}` : `[${name}]`;
|
|
62
63
|
let description = a.description || '';
|
|
63
64
|
if (a.default)
|
|
64
65
|
description = `${(0, theme_1.colorize)(this.config?.theme?.flagDefaultValue, `[default: ${a.default}]`)} ${description}`;
|
|
@@ -7,7 +7,7 @@ export type { HelpOptions } from './help';
|
|
|
7
7
|
export type { Hook, Hooks } from './hooks';
|
|
8
8
|
export type { Logger } from './logger';
|
|
9
9
|
export type { Manifest } from './manifest';
|
|
10
|
-
export type { Arg, ArgDefinition, ArgInput, BooleanFlag,
|
|
10
|
+
export type { Arg, ArgDefinition, ArgInput, BooleanFlag, CustomOptions, Deprecation, Flag, FlagDefinition, FlagInput, Input, OptionFlag, OutputArgs, OutputFlags, ParserOutput, } from './parser';
|
|
11
11
|
export type { LinkedPlugin, OclifConfiguration, PJSON, S3, S3Templates, UserPJSON, UserPlugin } from './pjson';
|
|
12
12
|
export type { Options, Plugin, PluginOptions } from './plugin';
|
|
13
13
|
export type { S3Manifest } from './s3-manifest';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Command } from '../command';
|
|
2
2
|
import { AlphabetLowercase, AlphabetUppercase } from './alphabet';
|
|
3
|
-
import { Config } from './config';
|
|
4
3
|
export type FlagOutput = {
|
|
5
4
|
[name: string]: any;
|
|
6
5
|
};
|
|
@@ -224,21 +223,6 @@ export type OptionFlagProps = FlagProps & {
|
|
|
224
223
|
* Should only be used on one flag at a time.
|
|
225
224
|
*/
|
|
226
225
|
allowStdin?: boolean | 'only';
|
|
227
|
-
/**
|
|
228
|
-
* Optional dynamic completion configuration.
|
|
229
|
-
* Provides intelligent autocomplete suggestions for flag values based on context.
|
|
230
|
-
* Requires autocomplete plugin to be installed.
|
|
231
|
-
*
|
|
232
|
-
* @example
|
|
233
|
-
* ```typescript
|
|
234
|
-
* completion: {
|
|
235
|
-
* options: async (ctx) => {
|
|
236
|
-
* return ['option1', 'option2', 'option3']
|
|
237
|
-
* }
|
|
238
|
-
* }
|
|
239
|
-
* ```
|
|
240
|
-
*/
|
|
241
|
-
completion?: Completion;
|
|
242
226
|
};
|
|
243
227
|
export type FlagParserContext = Command & {
|
|
244
228
|
token: FlagToken;
|
|
@@ -463,58 +447,6 @@ export type ParserInput = {
|
|
|
463
447
|
context: ParserContext | undefined;
|
|
464
448
|
'--'?: boolean | undefined;
|
|
465
449
|
};
|
|
466
|
-
/**
|
|
467
|
-
* Context provided to flag completion functions
|
|
468
|
-
*/
|
|
469
|
-
export type CompletionContext = {
|
|
470
|
-
/**
|
|
471
|
-
* Parsed arguments from the current command line
|
|
472
|
-
*/
|
|
473
|
-
args?: {
|
|
474
|
-
[name: string]: string;
|
|
475
|
-
};
|
|
476
|
-
/**
|
|
477
|
-
* Array of raw arguments
|
|
478
|
-
*/
|
|
479
|
-
argv?: string[];
|
|
480
|
-
/**
|
|
481
|
-
* oclif configuration object
|
|
482
|
-
*/
|
|
483
|
-
config: Config;
|
|
484
|
-
/**
|
|
485
|
-
* Parsed flags from the current command line
|
|
486
|
-
*/
|
|
487
|
-
flags?: {
|
|
488
|
-
[name: string]: string;
|
|
489
|
-
};
|
|
490
|
-
};
|
|
491
|
-
/**
|
|
492
|
-
* Completion configuration for a flag
|
|
493
|
-
*/
|
|
494
|
-
export type Completion = {
|
|
495
|
-
/**
|
|
496
|
-
* Function that returns completion options based on context
|
|
497
|
-
*
|
|
498
|
-
* @param ctx - Context containing parsed args, flags, and config
|
|
499
|
-
* @returns Promise resolving to array of completion strings
|
|
500
|
-
*
|
|
501
|
-
* @example
|
|
502
|
-
* ```typescript
|
|
503
|
-
* static flags = {
|
|
504
|
-
* 'target-org': Flags.string({
|
|
505
|
-
* description: 'Target org',
|
|
506
|
-
* completion: {
|
|
507
|
-
* options: async (ctx) => {
|
|
508
|
-
* const orgs = await getAuthenticatedOrgs()
|
|
509
|
-
* return orgs.map(o => o.alias)
|
|
510
|
-
* }
|
|
511
|
-
* }
|
|
512
|
-
* })
|
|
513
|
-
* }
|
|
514
|
-
* ```
|
|
515
|
-
*/
|
|
516
|
-
options(ctx: CompletionContext): Promise<string[]>;
|
|
517
|
-
};
|
|
518
450
|
export type ParserContext = Command & {
|
|
519
451
|
token?: FlagToken | ArgToken | undefined;
|
|
520
452
|
};
|