politty 0.4.13 → 0.4.14

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.
Files changed (65) hide show
  1. package/dist/{arg-registry-6E4C5MTC.d.ts → arg-registry-CkPDokIu.d.ts} +53 -14
  2. package/dist/arg-registry-CkPDokIu.d.ts.map +1 -0
  3. package/dist/{arg-registry-CeIRoLaB.d.cts → arg-registry-r5wYN6qd.d.cts} +53 -14
  4. package/dist/arg-registry-r5wYN6qd.d.cts.map +1 -0
  5. package/dist/augment.d.cts +3 -2
  6. package/dist/augment.d.cts.map +1 -1
  7. package/dist/augment.d.ts +3 -2
  8. package/dist/augment.d.ts.map +1 -1
  9. package/dist/completion/index.cjs +1 -1
  10. package/dist/completion/index.d.cts +1 -1
  11. package/dist/completion/index.d.ts +1 -1
  12. package/dist/completion/index.js +1 -1
  13. package/dist/{completion-D3LUac1o.cjs → completion-CAekGYS4.cjs} +24 -14
  14. package/dist/completion-CAekGYS4.cjs.map +1 -0
  15. package/dist/{completion-DzaT2YCN.js → completion-yHz8Pdr7.js} +23 -13
  16. package/dist/completion-yHz8Pdr7.js.map +1 -0
  17. package/dist/docs/index.cjs +21 -8
  18. package/dist/docs/index.cjs.map +1 -1
  19. package/dist/docs/index.d.cts +1 -1
  20. package/dist/docs/index.d.cts.map +1 -1
  21. package/dist/docs/index.d.ts +1 -1
  22. package/dist/docs/index.d.ts.map +1 -1
  23. package/dist/docs/index.js +21 -8
  24. package/dist/docs/index.js.map +1 -1
  25. package/dist/{index-BW02tH1-.d.cts → index-BLySW_2k.d.ts} +7 -4
  26. package/dist/index-BLySW_2k.d.ts.map +1 -0
  27. package/dist/{index-C3UtsvgY.d.ts → index-DPswv0Vt.d.cts} +7 -4
  28. package/dist/index-DPswv0Vt.d.cts.map +1 -0
  29. package/dist/index.cjs +3 -3
  30. package/dist/index.d.cts +2 -2
  31. package/dist/index.d.cts.map +1 -1
  32. package/dist/index.d.ts +2 -2
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +3 -3
  35. package/dist/{lazy-qPy4cMnv.cjs → lazy-AGV9Pkt5.cjs} +34 -3
  36. package/dist/lazy-AGV9Pkt5.cjs.map +1 -0
  37. package/dist/{lazy-xrzxwnru.js → lazy-DiMJSDMB.js} +28 -3
  38. package/dist/lazy-DiMJSDMB.js.map +1 -0
  39. package/dist/prompt/clack/index.cjs +1 -1
  40. package/dist/prompt/clack/index.d.cts +1 -1
  41. package/dist/prompt/clack/index.d.ts +1 -1
  42. package/dist/prompt/index.d.cts +1 -1
  43. package/dist/prompt/index.d.ts +1 -1
  44. package/dist/prompt/inquirer/index.cjs +1 -1
  45. package/dist/prompt/inquirer/index.d.cts +1 -1
  46. package/dist/prompt/inquirer/index.d.ts +1 -1
  47. package/dist/{runner-DA48D-3K.cjs → runner-CY5fOsSh.cjs} +76 -36
  48. package/dist/runner-CY5fOsSh.cjs.map +1 -0
  49. package/dist/{runner-CnG-Ncz0.js → runner-DSZw1AsW.js} +76 -36
  50. package/dist/runner-DSZw1AsW.js.map +1 -0
  51. package/dist/{subcommand-router-BhYVuS83.js → subcommand-router--EUt6ftA.js} +2 -2
  52. package/dist/{subcommand-router-BhYVuS83.js.map → subcommand-router--EUt6ftA.js.map} +1 -1
  53. package/dist/{subcommand-router-BnHpqyRk.cjs → subcommand-router-C9ONv6Nq.cjs} +2 -2
  54. package/dist/{subcommand-router-BnHpqyRk.cjs.map → subcommand-router-C9ONv6Nq.cjs.map} +1 -1
  55. package/package.json +12 -12
  56. package/dist/arg-registry-6E4C5MTC.d.ts.map +0 -1
  57. package/dist/arg-registry-CeIRoLaB.d.cts.map +0 -1
  58. package/dist/completion-D3LUac1o.cjs.map +0 -1
  59. package/dist/completion-DzaT2YCN.js.map +0 -1
  60. package/dist/index-BW02tH1-.d.cts.map +0 -1
  61. package/dist/index-C3UtsvgY.d.ts.map +0 -1
  62. package/dist/lazy-qPy4cMnv.cjs.map +0 -1
  63. package/dist/lazy-xrzxwnru.js.map +0 -1
  64. package/dist/runner-CnG-Ncz0.js.map +0 -1
  65. package/dist/runner-DA48D-3K.cjs.map +0 -1
@@ -9,8 +9,17 @@ interface ResolvedFieldMeta {
9
9
  name: string;
10
10
  /** CLI option name (kebab-case, for command line usage) */
11
11
  cliName: string;
12
- /** Short alias (e.g., 'v' for --verbose) */
13
- alias?: string | undefined;
12
+ /**
13
+ * Aliases for this option, normalized to an array.
14
+ * 1-char entries are short aliases (`-v`); multi-char entries are long
15
+ * aliases (`--to-be`).
16
+ */
17
+ alias?: string[] | undefined;
18
+ /**
19
+ * Aliases that are accepted at parse time but hidden from help,
20
+ * generated docs, and shell completion.
21
+ */
22
+ hiddenAlias?: string[] | undefined;
14
23
  /** Argument description */
15
24
  description?: string | undefined;
16
25
  /** Whether this is a positional argument */
@@ -586,17 +595,34 @@ interface BaseArgMeta<TValue = unknown> {
586
595
  }
587
596
  /**
588
597
  * Metadata for regular arguments (non-builtin aliases)
598
+ *
599
+ * `alias` accepts either a single string or an array of strings.
600
+ * Single-character entries become short options (e.g. `-v`); multi-character
601
+ * entries become additional long options (e.g. `--to-be` for `--tobe`).
589
602
  */
590
603
  interface RegularArgMeta<TValue = unknown> extends BaseArgMeta<TValue> {
591
- /** Short alias (e.g., 'v' for --verbose) */
592
- alias?: string;
604
+ /**
605
+ * Alias name(s) for this option.
606
+ * - 1-char string → short alias (`-v`)
607
+ * - >1-char string → long alias (`--long-name`)
608
+ * - array → multiple aliases of either kind
609
+ */
610
+ alias?: string | string[] | readonly string[];
611
+ /**
612
+ * Alias name(s) that are accepted by the parser but hidden from help,
613
+ * generated docs, and shell completion. Useful for legacy or deprecated
614
+ * names that should still work without being advertised.
615
+ */
616
+ hiddenAlias?: string | string[] | readonly string[];
593
617
  }
594
618
  /**
595
619
  * Metadata for overriding built-in aliases (-h, -H)
596
620
  */
597
621
  interface BuiltinOverrideArgMeta<TValue = unknown> extends BaseArgMeta<TValue> {
598
- /** Built-in alias to override ('h' or 'H') */
599
- alias: "h" | "H";
622
+ /** Built-in alias to override ('h' or 'H'), optionally combined with extra aliases */
623
+ alias: "h" | "H" | Array<"h" | "H" | string> | ReadonlyArray<"h" | "H" | string>;
624
+ /** Hidden aliases (accepted but not surfaced in help/docs/completion) */
625
+ hiddenAlias?: string | string[] | readonly string[];
600
626
  /** Must be true to override built-in aliases */
601
627
  overrideBuiltinAlias: true;
602
628
  }
@@ -628,18 +654,31 @@ type ArgMeta<TValue = unknown> = RegularArgMeta<TValue> | BuiltinOverrideArgMeta
628
654
  * ```
629
655
  */
630
656
  /**
631
- * Type helper to validate ArgMeta
632
- * Forces a type error if alias is "h" or "H" without overrideBuiltinAlias: true
657
+ * Detect whether `A` contains a reserved alias ("h" or "H"), for either a
658
+ * plain string or a tuple/array of strings. Uses `[A] extends [never]` to
659
+ * prevent distribution returning `never` for missing fields.
660
+ */
661
+ type ContainsReservedAlias<A> = [A] extends [never] ? false : A extends "h" | "H" ? true : A extends readonly (infer E)[] ? [Extract<E, "h" | "H">] extends [never] ? false : true : false;
662
+ type ReservedAliasTypeError<M> = { [K in keyof M]: M[K] } & {
663
+ __typeError: "Alias 'h' or 'H' requires overrideBuiltinAlias: true";
664
+ };
665
+ type AliasFieldOf<M> = M extends {
666
+ alias: infer A;
667
+ } ? A : never;
668
+ type HiddenAliasFieldOf<M> = M extends {
669
+ hiddenAlias: infer H;
670
+ } ? H : never;
671
+ /**
672
+ * Type helper to validate ArgMeta.
673
+ * Forces a type error when a reserved alias ("h" / "H") is used without
674
+ * `overrideBuiltinAlias: true`, whether the alias is provided as a string
675
+ * or as part of an array, and whether it appears in `alias` or `hiddenAlias`.
633
676
  */
634
677
  type ValidateArgMeta<M> = M extends {
635
- alias: "h" | "H";
636
- } ? M extends {
637
678
  overrideBuiltinAlias: true;
638
- } ? M : { [K in keyof M]: M[K] } & {
639
- __typeError: "Alias 'h' or 'H' requires overrideBuiltinAlias: true";
640
- } : M;
679
+ } ? M : ContainsReservedAlias<AliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ContainsReservedAlias<HiddenAliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : M;
641
680
  declare function arg<T extends z.ZodType>(schema: T): T;
642
681
  declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M>): T;
643
682
  //#endregion
644
683
  export { RunResultSuccess as A, UnknownKeysMode as B, Logger as C, RunCommandOptions as D, PromptResolver as E, LazyCommand as F, getUnknownKeysMode as H, isLazyCommand as I, lazy as L, SetupContext as M, SubCommandValue as N, RunResult as O, SubCommandsRecord as P, ExtractedFields as R, LogStream as S, NonRunnableCommand as T, toCamelCase as U, extractFields as V, toKebabCase as W, GlobalCleanupContext as _, EffectContext as a, LogEntry as b, arg as c, CleanupContext as d, CollectedLogs as f, GlobalArgs as g, Example as h, CustomCompletion as i, RunnableCommand as j, RunResultFailure as k, AnyCommand as l, CommandBase as m, CompletionMeta as n, PromptMeta as o, Command as p, CompletionType as r, PromptType as s, ArgMeta as t, ArgsSchema as u, GlobalSetupContext as v, MainOptions as w, LogLevel as x, IsEmpty as y, ResolvedFieldMeta as z };
645
- //# sourceMappingURL=arg-registry-6E4C5MTC.d.ts.map
684
+ //# sourceMappingURL=arg-registry-CkPDokIu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arg-registry-CkPDokIu.d.ts","names":[],"sources":["../src/core/schema-extractor.ts","../src/lazy.ts","../src/types.ts","../src/core/arg-registry.ts"],"mappings":";;;AAwCA;;;AAAA,UAAiB,iBAAA;EAwCF;EAtCb,IAAA;EA0CoC;EAxCpC,OAAA;EAwCwE;;;;;EAlCxE,KAAA;EAOA;;;;EAFA,WAAA;EAeA;EAbA,WAAA;EAiBA;EAfA,UAAA;EAeU;EAbV,WAAA;EAiBA;;;;EAZA,GAAA;EAkBA;EAhBA,QAAA;EAgBoC;EAdpC,YAAA;EAc6D;EAZ7D,IAAA;EAYwE;EAVxE,MAAA,EAAQ,CAAA,CAAE,OAAA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A,CAAgB,CAAA,IACrB,CAAA"}
@@ -9,8 +9,17 @@ interface ResolvedFieldMeta {
9
9
  name: string;
10
10
  /** CLI option name (kebab-case, for command line usage) */
11
11
  cliName: string;
12
- /** Short alias (e.g., 'v' for --verbose) */
13
- alias?: string | undefined;
12
+ /**
13
+ * Aliases for this option, normalized to an array.
14
+ * 1-char entries are short aliases (`-v`); multi-char entries are long
15
+ * aliases (`--to-be`).
16
+ */
17
+ alias?: string[] | undefined;
18
+ /**
19
+ * Aliases that are accepted at parse time but hidden from help,
20
+ * generated docs, and shell completion.
21
+ */
22
+ hiddenAlias?: string[] | undefined;
14
23
  /** Argument description */
15
24
  description?: string | undefined;
16
25
  /** Whether this is a positional argument */
@@ -586,17 +595,34 @@ interface BaseArgMeta<TValue = unknown> {
586
595
  }
587
596
  /**
588
597
  * Metadata for regular arguments (non-builtin aliases)
598
+ *
599
+ * `alias` accepts either a single string or an array of strings.
600
+ * Single-character entries become short options (e.g. `-v`); multi-character
601
+ * entries become additional long options (e.g. `--to-be` for `--tobe`).
589
602
  */
590
603
  interface RegularArgMeta<TValue = unknown> extends BaseArgMeta<TValue> {
591
- /** Short alias (e.g., 'v' for --verbose) */
592
- alias?: string;
604
+ /**
605
+ * Alias name(s) for this option.
606
+ * - 1-char string → short alias (`-v`)
607
+ * - >1-char string → long alias (`--long-name`)
608
+ * - array → multiple aliases of either kind
609
+ */
610
+ alias?: string | string[] | readonly string[];
611
+ /**
612
+ * Alias name(s) that are accepted by the parser but hidden from help,
613
+ * generated docs, and shell completion. Useful for legacy or deprecated
614
+ * names that should still work without being advertised.
615
+ */
616
+ hiddenAlias?: string | string[] | readonly string[];
593
617
  }
594
618
  /**
595
619
  * Metadata for overriding built-in aliases (-h, -H)
596
620
  */
597
621
  interface BuiltinOverrideArgMeta<TValue = unknown> extends BaseArgMeta<TValue> {
598
- /** Built-in alias to override ('h' or 'H') */
599
- alias: "h" | "H";
622
+ /** Built-in alias to override ('h' or 'H'), optionally combined with extra aliases */
623
+ alias: "h" | "H" | Array<"h" | "H" | string> | ReadonlyArray<"h" | "H" | string>;
624
+ /** Hidden aliases (accepted but not surfaced in help/docs/completion) */
625
+ hiddenAlias?: string | string[] | readonly string[];
600
626
  /** Must be true to override built-in aliases */
601
627
  overrideBuiltinAlias: true;
602
628
  }
@@ -628,18 +654,31 @@ type ArgMeta<TValue = unknown> = RegularArgMeta<TValue> | BuiltinOverrideArgMeta
628
654
  * ```
629
655
  */
630
656
  /**
631
- * Type helper to validate ArgMeta
632
- * Forces a type error if alias is "h" or "H" without overrideBuiltinAlias: true
657
+ * Detect whether `A` contains a reserved alias ("h" or "H"), for either a
658
+ * plain string or a tuple/array of strings. Uses `[A] extends [never]` to
659
+ * prevent distribution returning `never` for missing fields.
660
+ */
661
+ type ContainsReservedAlias<A> = [A] extends [never] ? false : A extends "h" | "H" ? true : A extends readonly (infer E)[] ? [Extract<E, "h" | "H">] extends [never] ? false : true : false;
662
+ type ReservedAliasTypeError<M> = { [K in keyof M]: M[K] } & {
663
+ __typeError: "Alias 'h' or 'H' requires overrideBuiltinAlias: true";
664
+ };
665
+ type AliasFieldOf<M> = M extends {
666
+ alias: infer A;
667
+ } ? A : never;
668
+ type HiddenAliasFieldOf<M> = M extends {
669
+ hiddenAlias: infer H;
670
+ } ? H : never;
671
+ /**
672
+ * Type helper to validate ArgMeta.
673
+ * Forces a type error when a reserved alias ("h" / "H") is used without
674
+ * `overrideBuiltinAlias: true`, whether the alias is provided as a string
675
+ * or as part of an array, and whether it appears in `alias` or `hiddenAlias`.
633
676
  */
634
677
  type ValidateArgMeta<M> = M extends {
635
- alias: "h" | "H";
636
- } ? M extends {
637
678
  overrideBuiltinAlias: true;
638
- } ? M : { [K in keyof M]: M[K] } & {
639
- __typeError: "Alias 'h' or 'H' requires overrideBuiltinAlias: true";
640
- } : M;
679
+ } ? M : ContainsReservedAlias<AliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : ContainsReservedAlias<HiddenAliasFieldOf<M>> extends true ? ReservedAliasTypeError<M> : M;
641
680
  declare function arg<T extends z.ZodType>(schema: T): T;
642
681
  declare function arg<T extends z.ZodType, M extends ArgMeta<z.output<T>>>(schema: T, meta: ValidateArgMeta<M>): T;
643
682
  //#endregion
644
683
  export { RunResultSuccess as A, UnknownKeysMode as B, Logger as C, RunCommandOptions as D, PromptResolver as E, LazyCommand as F, getUnknownKeysMode as H, isLazyCommand as I, lazy as L, SetupContext as M, SubCommandValue as N, RunResult as O, SubCommandsRecord as P, ExtractedFields as R, LogStream as S, NonRunnableCommand as T, toCamelCase as U, extractFields as V, toKebabCase as W, GlobalCleanupContext as _, EffectContext as a, LogEntry as b, arg as c, CleanupContext as d, CollectedLogs as f, GlobalArgs as g, Example as h, CustomCompletion as i, RunnableCommand as j, RunResultFailure as k, AnyCommand as l, CommandBase as m, CompletionMeta as n, PromptMeta as o, Command as p, CompletionType as r, PromptType as s, ArgMeta as t, ArgsSchema as u, GlobalSetupContext as v, MainOptions as w, LogLevel as x, IsEmpty as y, ResolvedFieldMeta as z };
645
- //# sourceMappingURL=arg-registry-CeIRoLaB.d.cts.map
684
+ //# sourceMappingURL=arg-registry-r5wYN6qd.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arg-registry-r5wYN6qd.d.cts","names":[],"sources":["../src/core/schema-extractor.ts","../src/lazy.ts","../src/types.ts","../src/core/arg-registry.ts"],"mappings":";;;AAwCA;;;AAAA,UAAiB,iBAAA;EAwCF;EAtCb,IAAA;EA0CoC;EAxCpC,OAAA;EAwCwE;;;;;EAlCxE,KAAA;EAOA;;;;EAFA,WAAA;EAeA;EAbA,WAAA;EAiBA;EAfA,UAAA;EAeU;EAbV,WAAA;EAiBA;;;;EAZA,GAAA;EAkBA;EAhBA,QAAA;EAgBoC;EAdpC,YAAA;EAc6D;EAZ7D,IAAA;EAYwE;EAVxE,MAAA,EAAQ,CAAA,CAAE,OAAA;EAgBoB;EAd9B,oBAAA;EAgBQ;EAdR,UAAA;EAwBU;EAt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t as ArgMeta } from "./arg-registry-CeIRoLaB.cjs";
1
+ import { t as ArgMeta } from "./arg-registry-r5wYN6qd.cjs";
2
2
 
3
3
  //#region src/augment.d.ts
4
4
  declare module "zod" {
@@ -9,7 +9,8 @@ declare module "zod" {
9
9
  description?: string;
10
10
  positional?: boolean;
11
11
  placeholder?: string;
12
- alias?: string;
12
+ alias?: string | string[] | readonly string[];
13
+ hiddenAlias?: string | string[] | readonly string[];
13
14
  overrideBuiltinAlias?: boolean;
14
15
  }
15
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"augment.d.cts","names":[],"sources":["../src/augment.ts"],"mappings":";;;;YAiBY,UAAA;IACR,OAAA,GAAU,OAAA;EAAA;EAAA,UAGF,UAAA;IACR,WAAA;IACA,UAAA;IACA,WAAA;IACA,KAAA;IACA,oBAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"augment.d.cts","names":[],"sources":["../src/augment.ts"],"mappings":";;;;YAiBY,UAAA;IACR,OAAA,GAAU,OAAA;EAAA;EAAA,UAGF,UAAA;IACR,WAAA;IACA,UAAA;IACA,WAAA;IACA,KAAA;IACA,WAAA;IACA,oBAAA;EAAA;AAAA"}
package/dist/augment.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as ArgMeta } from "./arg-registry-6E4C5MTC.js";
1
+ import { t as ArgMeta } from "./arg-registry-CkPDokIu.js";
2
2
 
3
3
  //#region src/augment.d.ts
4
4
  declare module "zod" {
@@ -9,7 +9,8 @@ declare module "zod" {
9
9
  description?: string;
10
10
  positional?: boolean;
11
11
  placeholder?: string;
12
- alias?: string;
12
+ alias?: string | string[] | readonly string[];
13
+ hiddenAlias?: string | string[] | readonly string[];
13
14
  overrideBuiltinAlias?: boolean;
14
15
  }
15
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"augment.d.ts","names":[],"sources":["../src/augment.ts"],"mappings":";;;;YAiBY,UAAA;IACR,OAAA,GAAU,OAAA;EAAA;EAAA,UAGF,UAAA;IACR,WAAA;IACA,UAAA;IACA,WAAA;IACA,KAAA;IACA,oBAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"augment.d.ts","names":[],"sources":["../src/augment.ts"],"mappings":";;;;YAiBY,UAAA;IACR,OAAA,GAAU,OAAA;EAAA;EAAA,UAGF,UAAA;IACR,WAAA;IACA,UAAA;IACA,WAAA;IACA,KAAA;IACA,WAAA;IACA,oBAAA;EAAA;AAAA"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_completion = require('../completion-D3LUac1o.cjs');
2
+ const require_completion = require('../completion-CAekGYS4.cjs');
3
3
 
4
4
  exports.CompletionDirective = require_completion.CompletionDirective;
5
5
  exports.createCompletionCommand = require_completion.createCompletionCommand;
@@ -1,2 +1,2 @@
1
- import { C as CompletableSubcommand, D as CompletionResult, E as CompletionOptions, O as ShellType, S as CompletableOption, T as CompletionGenerator, _ as CompletionDirective, a as getSupportedShells, b as CompletionType, c as resolveValueCompletion, d as ShellFormatOptions, f as formatForShell, g as CompletionCandidate, h as CandidateResult, i as generateCompletion, l as extractCompletionData, m as hasCompleteCommand, n as createCompletionCommand, o as withCompletionCommand, p as createDynamicCompleteCommand, r as detectShell, s as ValueCompletionField, t as WithCompletionOptions, u as extractPositionals, v as generateCandidates, w as CompletionData, x as parseCompletionContext, y as CompletionContext } from "../index-BW02tH1-.cjs";
1
+ import { C as CompletableSubcommand, D as CompletionResult, E as CompletionOptions, O as ShellType, S as CompletableOption, T as CompletionGenerator, _ as CompletionDirective, a as getSupportedShells, b as CompletionType, c as resolveValueCompletion, d as ShellFormatOptions, f as formatForShell, g as CompletionCandidate, h as CandidateResult, i as generateCompletion, l as extractCompletionData, m as hasCompleteCommand, n as createCompletionCommand, o as withCompletionCommand, p as createDynamicCompleteCommand, r as detectShell, s as ValueCompletionField, t as WithCompletionOptions, u as extractPositionals, v as generateCandidates, w as CompletionData, x as parseCompletionContext, y as CompletionContext } from "../index-DPswv0Vt.cjs";
2
2
  export { CandidateResult, CompletableOption, CompletableSubcommand, CompletionCandidate, CompletionContext, CompletionData, CompletionDirective, CompletionGenerator, CompletionOptions, CompletionResult, CompletionType, ShellFormatOptions, ShellType, ValueCompletionField, WithCompletionOptions, createCompletionCommand, createDynamicCompleteCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
@@ -1,2 +1,2 @@
1
- import { C as CompletableSubcommand, D as CompletionResult, E as CompletionOptions, O as ShellType, S as CompletableOption, T as CompletionGenerator, _ as CompletionDirective, a as getSupportedShells, b as CompletionType, c as resolveValueCompletion, d as ShellFormatOptions, f as formatForShell, g as CompletionCandidate, h as CandidateResult, i as generateCompletion, l as extractCompletionData, m as hasCompleteCommand, n as createCompletionCommand, o as withCompletionCommand, p as createDynamicCompleteCommand, r as detectShell, s as ValueCompletionField, t as WithCompletionOptions, u as extractPositionals, v as generateCandidates, w as CompletionData, x as parseCompletionContext, y as CompletionContext } from "../index-C3UtsvgY.js";
1
+ import { C as CompletableSubcommand, D as CompletionResult, E as CompletionOptions, O as ShellType, S as CompletableOption, T as CompletionGenerator, _ as CompletionDirective, a as getSupportedShells, b as CompletionType, c as resolveValueCompletion, d as ShellFormatOptions, f as formatForShell, g as CompletionCandidate, h as CandidateResult, i as generateCompletion, l as extractCompletionData, m as hasCompleteCommand, n as createCompletionCommand, o as withCompletionCommand, p as createDynamicCompleteCommand, r as detectShell, s as ValueCompletionField, t as WithCompletionOptions, u as extractPositionals, v as generateCandidates, w as CompletionData, x as parseCompletionContext, y as CompletionContext } from "../index-BLySW_2k.js";
2
2
  export { CandidateResult, CompletableOption, CompletableSubcommand, CompletionCandidate, CompletionContext, CompletionData, CompletionDirective, CompletionGenerator, CompletionOptions, CompletionResult, CompletionType, ShellFormatOptions, ShellType, ValueCompletionField, WithCompletionOptions, createCompletionCommand, createDynamicCompleteCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
@@ -1,3 +1,3 @@
1
- import { a as withCompletionCommand, c as formatForShell, d as generateCandidates, f as extractCompletionData, i as getSupportedShells, l as parseCompletionContext, m as resolveValueCompletion, n as detectShell, o as createDynamicCompleteCommand, p as extractPositionals, r as generateCompletion, s as hasCompleteCommand, t as createCompletionCommand, u as CompletionDirective } from "../completion-DzaT2YCN.js";
1
+ import { a as withCompletionCommand, c as formatForShell, d as generateCandidates, f as extractCompletionData, i as getSupportedShells, l as parseCompletionContext, m as resolveValueCompletion, n as detectShell, o as createDynamicCompleteCommand, p as extractPositionals, r as generateCompletion, s as hasCompleteCommand, t as createCompletionCommand, u as CompletionDirective } from "../completion-yHz8Pdr7.js";
2
2
 
3
3
  export { CompletionDirective, createCompletionCommand, createDynamicCompleteCommand, detectShell, extractCompletionData, extractPositionals, formatForShell, generateCandidates, generateCompletion, getSupportedShells, hasCompleteCommand, parseCompletionContext, resolveValueCompletion, withCompletionCommand };
@@ -1,5 +1,5 @@
1
- const require_subcommand_router = require('./subcommand-router-BnHpqyRk.cjs');
2
- const require_lazy = require('./lazy-qPy4cMnv.cjs');
1
+ const require_subcommand_router = require('./subcommand-router-C9ONv6Nq.cjs');
2
+ const require_lazy = require('./lazy-AGV9Pkt5.cjs');
3
3
  let zod = require("zod");
4
4
  let node_child_process = require("node:child_process");
5
5
 
@@ -192,7 +192,7 @@ function optTakesValueEntries(sub, parentPath) {
192
192
  const lines = [];
193
193
  for (const opt of sub.options) if (opt.takesValue) {
194
194
  const patterns = [`${parentPath}:--${opt.cliName}`];
195
- if (opt.alias) patterns.push(`${parentPath}:-${opt.alias}`);
195
+ if (opt.alias) for (const a of opt.alias) patterns.push(`${parentPath}:${a.length === 1 ? `-${a}` : `--${a}`}`);
196
196
  lines.push(` ${patterns.join("|")}) return 0 ;;`);
197
197
  }
198
198
  for (const child of getVisibleSubs(sub.subcommands)) lines.push(...optTakesValueEntries(child, joinPrefix(parentPath, child.name, ":")));
@@ -332,7 +332,7 @@ function optionValueCases$2(options, inline) {
332
332
  const valLines = bashValueLines(opt.valueCompletion, inline);
333
333
  if (valLines.length === 0) continue;
334
334
  const patterns = [`--${opt.cliName}`];
335
- if (opt.alias) patterns.push(`-${opt.alias}`);
335
+ if (opt.alias) for (const a of opt.alias) patterns.push(a.length === 1 ? `-${a}` : `--${a}`);
336
336
  const patternStr = patterns.join("|");
337
337
  lines.push(` ${patternStr})`);
338
338
  for (const vl of valLines) lines.push(` ${vl}`);
@@ -382,7 +382,7 @@ function availableOptionLines$2(options, fn) {
382
382
  for (const opt of options) if (opt.valueType === "array") lines.push(` _avail+=(--${opt.cliName})`);
383
383
  else {
384
384
  const patterns = [`"--${opt.cliName}"`];
385
- if (opt.alias) patterns.push(`"-${opt.alias}"`);
385
+ if (opt.alias) for (const a of opt.alias) patterns.push(a.length === 1 ? `"-${a}"` : `"--${a}"`);
386
386
  lines.push(` __${fn}_not_used ${patterns.join(" ")} && _avail+=(--${opt.cliName})`);
387
387
  }
388
388
  lines.push(` __${fn}_not_used "--help" && _avail+=(--help)`);
@@ -693,7 +693,9 @@ function generateOptionNameCandidates(context) {
693
693
  const directive = CompletionDirective.FilterPrefix;
694
694
  const availableOptions = context.options.filter((opt) => {
695
695
  if (opt.valueType === "array") return true;
696
- return !context.usedOptions.has(opt.cliName) && !context.usedOptions.has(opt.alias || "");
696
+ if (context.usedOptions.has(opt.cliName)) return false;
697
+ if (opt.alias && opt.alias.some((a) => context.usedOptions.has(a))) return false;
698
+ return true;
697
699
  });
698
700
  for (const opt of availableOptions) candidates.push({
699
701
  value: `--${opt.cliName}`,
@@ -831,7 +833,15 @@ function hasInlineValue(word) {
831
833
  * Find option by name or alias
832
834
  */
833
835
  function findOption(options, nameOrAlias) {
834
- return options.find((opt) => opt.cliName === nameOrAlias || opt.alias === nameOrAlias);
836
+ return options.find((opt) => {
837
+ if (opt.cliName === nameOrAlias) return true;
838
+ if (opt.alias?.includes(nameOrAlias)) return true;
839
+ if (nameOrAlias.length > 1) {
840
+ if (opt.cliName.includes("-") && require_lazy.toCamelCase(opt.cliName) === nameOrAlias) return true;
841
+ if (opt.alias?.some((a) => a.includes("-") && require_lazy.toCamelCase(a) === nameOrAlias)) return true;
842
+ }
843
+ return false;
844
+ });
835
845
  }
836
846
  /**
837
847
  * Parse completion context from command line arguments
@@ -860,7 +870,7 @@ function parseCompletionContext(argv, rootCommand) {
860
870
  const opt = findOption(options, optName);
861
871
  if (opt) {
862
872
  usedOptions.add(opt.cliName);
863
- if (opt.alias) usedOptions.add(opt.alias);
873
+ if (opt.alias) for (const a of opt.alias) usedOptions.add(a);
864
874
  if (opt.takesValue && !hasInlineValue(word)) i++;
865
875
  }
866
876
  i++;
@@ -1150,7 +1160,7 @@ function optionValueCases$1(options) {
1150
1160
  const valLines = fishValueLines(opt.valueCompletion);
1151
1161
  if (valLines.length === 0) continue;
1152
1162
  const conditions = [`test "$_prev" = "--${opt.cliName}"`];
1153
- if (opt.alias) conditions.push(`test "$_prev" = "-${opt.alias}"`);
1163
+ if (opt.alias) for (const a of opt.alias) conditions.push(`test "$_prev" = "${a.length === 1 ? `-${a}` : `--${a}`}"`);
1154
1164
  const cond = conditions.join("; or ");
1155
1165
  lines.push(` if ${cond}`);
1156
1166
  for (const vl of valLines) lines.push(` ${vl}`);
@@ -1182,7 +1192,7 @@ function availableOptionLines$1(options, fn) {
1182
1192
  if (opt.valueType === "array") lines.push(` echo "--${opt.cliName}\t${desc}"`);
1183
1193
  else {
1184
1194
  const checks = [`"--${opt.cliName}"`];
1185
- if (opt.alias) checks.push(`"-${opt.alias}"`);
1195
+ if (opt.alias) for (const a of opt.alias) checks.push(a.length === 1 ? `"-${a}"` : `"--${a}"`);
1186
1196
  lines.push(` __${fn}_not_used ${checks.join(" ")}; and echo "--${opt.cliName}\t${desc}"`);
1187
1197
  }
1188
1198
  }
@@ -1232,7 +1242,7 @@ function optTakesValueCases(sub, parentPath) {
1232
1242
  const lines = [];
1233
1243
  for (const opt of sub.options) if (opt.takesValue) {
1234
1244
  const patterns = [`"${parentPath}:--${opt.cliName}"`];
1235
- if (opt.alias) patterns.push(`"${parentPath}:-${opt.alias}"`);
1245
+ if (opt.alias) for (const a of opt.alias) patterns.push(`"${parentPath}:${a.length === 1 ? `-${a}` : `--${a}`}"`);
1236
1246
  lines.push(` case ${patterns.join(" ")}`);
1237
1247
  lines.push(` return 0`);
1238
1248
  }
@@ -1407,7 +1417,7 @@ function optionValueCases(options, fn) {
1407
1417
  const valLines = zshValueLines(opt.valueCompletion, fn);
1408
1418
  if (valLines.length === 0) continue;
1409
1419
  const patterns = [`--${opt.cliName}`];
1410
- if (opt.alias) patterns.push(`-${opt.alias}`);
1420
+ if (opt.alias) for (const a of opt.alias) patterns.push(a.length === 1 ? `-${a}` : `--${a}`);
1411
1421
  lines.push(` ${patterns.join("|")})`);
1412
1422
  for (const vl of valLines) lines.push(` ${vl}`);
1413
1423
  lines.push(` return 0 ;;`);
@@ -1448,7 +1458,7 @@ function availableOptionLines(options, fn) {
1448
1458
  if (opt.valueType === "array") lines.push(` _opts+=("--${opt.cliName}${desc}")`);
1449
1459
  else {
1450
1460
  const patterns = [`"--${opt.cliName}"`];
1451
- if (opt.alias) patterns.push(`"-${opt.alias}"`);
1461
+ if (opt.alias) for (const a of opt.alias) patterns.push(a.length === 1 ? `"-${a}"` : `"--${a}"`);
1452
1462
  lines.push(` __${fn}_not_used ${patterns.join(" ")} && _opts+=("--${opt.cliName}${desc}")`);
1453
1463
  }
1454
1464
  }
@@ -1872,4 +1882,4 @@ Object.defineProperty(exports, 'withCompletionCommand', {
1872
1882
  return withCompletionCommand;
1873
1883
  }
1874
1884
  });
1875
- //# sourceMappingURL=completion-D3LUac1o.cjs.map
1885
+ //# sourceMappingURL=completion-CAekGYS4.cjs.map