@oclif/core 2.15.0 → 2.16.0
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/command.d.ts +3 -0
- package/lib/config/config.js +14 -0
- package/package.json +1 -1
package/lib/command.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ export declare abstract class Command {
|
|
|
27
27
|
static description: string | undefined;
|
|
28
28
|
/** Hide the command from help */
|
|
29
29
|
static hidden: boolean;
|
|
30
|
+
/** An array of aliases for this command that are hidden from help. */
|
|
31
|
+
static hiddenAliases: string[];
|
|
30
32
|
/** Mark the command as a given state (e.g. beta or deprecated) in help */
|
|
31
33
|
static state?: 'beta' | 'deprecated' | string;
|
|
32
34
|
static deprecationOptions?: Deprecation;
|
|
@@ -138,6 +140,7 @@ export declare namespace Command {
|
|
|
138
140
|
[key: string]: unknown;
|
|
139
141
|
id: string;
|
|
140
142
|
hidden: boolean;
|
|
143
|
+
hiddenAliases: string[];
|
|
141
144
|
state?: 'beta' | 'deprecated' | string;
|
|
142
145
|
deprecationOptions?: Deprecation;
|
|
143
146
|
aliases: string[];
|
package/lib/config/config.js
CHANGED
|
@@ -573,6 +573,19 @@ class Config {
|
|
|
573
573
|
this.commandPermutations.add(permutation, command.id);
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
+
for (const alias of command.hiddenAliases ?? []) {
|
|
577
|
+
if (this._commands.has(alias)) {
|
|
578
|
+
const prioritizedCommand = this.determinePriority([this._commands.get(alias), command]);
|
|
579
|
+
this._commands.set(alias, { ...prioritizedCommand, id: alias });
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
this._commands.set(alias, { ...command, id: alias });
|
|
583
|
+
}
|
|
584
|
+
const aliasPermutations = this.flexibleTaxonomy ? (0, util_2.getCommandIdPermutations)(alias) : [alias];
|
|
585
|
+
for (const permutation of aliasPermutations) {
|
|
586
|
+
this.commandPermutations.add(permutation, command.id);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
576
589
|
}
|
|
577
590
|
marker?.addDetails({ commandCount: plugin.commands.length });
|
|
578
591
|
marker?.stop();
|
|
@@ -799,6 +812,7 @@ async function toCached(c, plugin, isWritingManifest) {
|
|
|
799
812
|
hidden: c.hidden,
|
|
800
813
|
state: c.state,
|
|
801
814
|
aliases: c.aliases || [],
|
|
815
|
+
hiddenAliases: c.hiddenAliases || [],
|
|
802
816
|
examples: c.examples || c.example,
|
|
803
817
|
deprecationOptions: c.deprecationOptions,
|
|
804
818
|
deprecateAliases: c.deprecateAliases,
|