@optique/core 0.10.0-dev.367 → 0.10.0-dev.369
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/facade.cjs +1 -7
- package/dist/facade.js +2 -8
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/message.cjs +18 -1
- package/dist/message.d.cts +20 -1
- package/dist/message.d.ts +20 -1
- package/dist/message.js +18 -2
- package/package.json +1 -1
package/dist/facade.cjs
CHANGED
|
@@ -69,13 +69,7 @@ function createCompletionParser(mode, programName, availableShells, name = "both
|
|
|
69
69
|
const completionCommandConfig = {
|
|
70
70
|
brief: require_message.message`Generate shell completion script or provide completions.`,
|
|
71
71
|
description: require_message.message`Generate shell completion script or provide completions.`,
|
|
72
|
-
footer: require_message.message`Examples:
|
|
73
|
-
Bash: ${require_message.commandLine(`eval "$(${programName} ${commandName} bash)"`)}
|
|
74
|
-
zsh: ${require_message.commandLine(`eval "$(${programName} ${commandName} zsh)"`)}
|
|
75
|
-
fish: ${require_message.commandLine(`eval "$(${programName} ${commandName} fish)"`)}
|
|
76
|
-
PowerShell: ${require_message.commandLine(`${programName} ${commandName} pwsh > ${programName}-completion.ps1; . ./${programName}-completion.ps1`)}
|
|
77
|
-
Nushell: ${require_message.commandLine(`${programName} ${commandName} nu | save ${programName}-completion.nu; source ./${programName}-completion.nu`)}
|
|
78
|
-
`
|
|
72
|
+
footer: require_message.message`Examples:${require_message.lineBreak()} Bash: ${require_message.commandLine(`eval "$(${programName} ${commandName} bash)"`)}${require_message.lineBreak()} zsh: ${require_message.commandLine(`eval "$(${programName} ${commandName} zsh)"`)}${require_message.lineBreak()} fish: ${require_message.commandLine(`eval "$(${programName} ${commandName} fish)"`)}${require_message.lineBreak()} PowerShell: ${require_message.commandLine(`${programName} ${commandName} pwsh > ${programName}-completion.ps1; . ./${programName}-completion.ps1`)}${require_message.lineBreak()} Nushell: ${require_message.commandLine(`${programName} ${commandName} nu | save ${programName}-completion.nu; source ./${programName}-completion.nu`)}`
|
|
79
73
|
};
|
|
80
74
|
const completionCommands = [];
|
|
81
75
|
const showSingular = helpVisibility === "singular" || helpVisibility === "both";
|
package/dist/facade.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { annotationKey } from "./annotations.js";
|
|
2
|
-
import { commandLine, formatMessage, message, optionName, text, value } from "./message.js";
|
|
2
|
+
import { commandLine, formatMessage, lineBreak, message, optionName, text, value } from "./message.js";
|
|
3
3
|
import { bash, fish, nu, pwsh, zsh } from "./completion.js";
|
|
4
4
|
import { formatUsage } from "./usage.js";
|
|
5
5
|
import { longestMatch, object } from "./constructs.js";
|
|
@@ -69,13 +69,7 @@ function createCompletionParser(mode, programName, availableShells, name = "both
|
|
|
69
69
|
const completionCommandConfig = {
|
|
70
70
|
brief: message`Generate shell completion script or provide completions.`,
|
|
71
71
|
description: message`Generate shell completion script or provide completions.`,
|
|
72
|
-
footer: message`Examples:
|
|
73
|
-
Bash: ${commandLine(`eval "$(${programName} ${commandName} bash)"`)}
|
|
74
|
-
zsh: ${commandLine(`eval "$(${programName} ${commandName} zsh)"`)}
|
|
75
|
-
fish: ${commandLine(`eval "$(${programName} ${commandName} fish)"`)}
|
|
76
|
-
PowerShell: ${commandLine(`${programName} ${commandName} pwsh > ${programName}-completion.ps1; . ./${programName}-completion.ps1`)}
|
|
77
|
-
Nushell: ${commandLine(`${programName} ${commandName} nu | save ${programName}-completion.nu; source ./${programName}-completion.nu`)}
|
|
78
|
-
`
|
|
72
|
+
footer: message`Examples:${lineBreak()} Bash: ${commandLine(`eval "$(${programName} ${commandName} bash)"`)}${lineBreak()} zsh: ${commandLine(`eval "$(${programName} ${commandName} zsh)"`)}${lineBreak()} fish: ${commandLine(`eval "$(${programName} ${commandName} fish)"`)}${lineBreak()} PowerShell: ${commandLine(`${programName} ${commandName} pwsh > ${programName}-completion.ps1; . ./${programName}-completion.ps1`)}${lineBreak()} Nushell: ${commandLine(`${programName} ${commandName} nu | save ${programName}-completion.nu; source ./${programName}-completion.nu`)}`
|
|
79
73
|
};
|
|
80
74
|
const completionCommands = [];
|
|
81
75
|
const showSingular = helpVisibility === "singular" || helpVisibility === "both";
|
package/dist/index.cjs
CHANGED
|
@@ -75,6 +75,7 @@ exports.isNonEmptyString = require_nonempty.isNonEmptyString;
|
|
|
75
75
|
exports.isPendingDependencySourceState = require_dependency.isPendingDependencySourceState;
|
|
76
76
|
exports.isValueParser = require_valueparser.isValueParser;
|
|
77
77
|
exports.isWrappedDependencySource = require_dependency.isWrappedDependencySource;
|
|
78
|
+
exports.lineBreak = require_message.lineBreak;
|
|
78
79
|
exports.link = require_message.link;
|
|
79
80
|
exports.locale = require_valueparser.locale;
|
|
80
81
|
exports.longestMatch = require_constructs.longestMatch;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Annotations, ParseOptions, annotationKey, getAnnotations } from "./annotations.cjs";
|
|
2
2
|
import { NonEmptyString, ensureNonEmptyString, isNonEmptyString } from "./nonempty.cjs";
|
|
3
|
-
import { Message, MessageFormatOptions, MessageTerm, ValueSetOptions, commandLine, envVar, formatMessage, link, message, metavar, optionName, optionNames, text, value, valueSet, values } from "./message.cjs";
|
|
3
|
+
import { Message, MessageFormatOptions, MessageTerm, ValueSetOptions, commandLine, envVar, formatMessage, lineBreak, link, message, metavar, optionName, optionNames, text, value, valueSet, values } from "./message.cjs";
|
|
4
4
|
import { OptionName, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, extractArgumentMetavars, extractCommandNames, extractOptionNames, formatUsage, formatUsageTerm, normalizeUsage } from "./usage.cjs";
|
|
5
5
|
import { DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, ShowDefaultOptions, formatDocPage } from "./doc.cjs";
|
|
6
6
|
import { ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, CidrOptions, CidrValue, DomainOptions, EmailOptions, FloatOptions, HostnameOptions, IntegerOptionsBigInt, IntegerOptionsNumber, IpOptions, Ipv4Options, Ipv6Options, LocaleOptions, MacAddressOptions, PortOptionsBigInt, PortOptionsNumber, PortRangeOptionsBigInt, PortRangeOptionsNumber, PortRangeValueBigInt, PortRangeValueNumber, SocketAddressOptions, SocketAddressValue, StringOptions, UrlOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, choice, cidr, domain, email, float, hostname, integer, ip, ipv4, ipv6, isValueParser, locale, macAddress, port, portRange, socketAddress, string, url, uuid } from "./valueparser.cjs";
|
|
@@ -12,4 +12,4 @@ import { CombineModes, DocState, InferMode, InferValue, Mode, ModeIterable, Mode
|
|
|
12
12
|
import { ShellCompletion, bash, fish, nu, pwsh, zsh } from "./completion.cjs";
|
|
13
13
|
import { ParserValuePlaceholder, SourceContext } from "./context.cjs";
|
|
14
14
|
import { CompletionHelpVisibility, CompletionName, ExtractRequiredOptions, RunOptions, RunParserError, RunWithOptions, SubstituteParserValue, runParser, runParserAsync, runParserSync, runWith, runWithAsync, runWithSync } from "./facade.cjs";
|
|
15
|
-
export { type Annotations, AnyDependencySource, ArgumentErrorOptions, ArgumentOptions, ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, CidrOptions, CidrValue, CombineMode, CombineModes, CombinedDependencyMode, CommandErrorOptions, CommandOptions, CompletionHelpVisibility, CompletionName, ConditionalErrorOptions, ConditionalOptions, DeferredParseState, DependencyError, DependencyMode, DependencyRegistry, DependencySource, DependencySourceState, DependencyValue, DependencyValues, DeriveAsyncOptions, DeriveFromAsyncOptions, DeriveFromOptions, DeriveFromSyncOptions, DeriveOptions, DeriveSyncOptions, DerivedValueParser, DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, DocState, DomainOptions, DuplicateOptionError, EmailOptions, ExtractRequiredOptions, FlagErrorOptions, FlagOptions, FloatOptions, HostnameOptions, InferMode, InferValue, IntegerOptionsBigInt, IntegerOptionsNumber, IpOptions, Ipv4Options, Ipv6Options, LocaleOptions, LongestMatchErrorOptions, LongestMatchOptions, MacAddressOptions, MergeOptions, type Message, type MessageFormatOptions, type MessageTerm, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, NonEmptyString, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionName, OptionOptions, OptionState, OrErrorOptions, OrOptions, type ParseOptions, Parser, ParserContext, ParserResult, ParserValuePlaceholder, PassThroughFormat, PassThroughOptions, PendingDependencySourceState, PortOptionsBigInt, PortOptionsNumber, PortRangeOptionsBigInt, PortRangeOptionsNumber, PortRangeValueBigInt, PortRangeValueNumber, ResolvedDependency, Result, RunOptions, RunParserError, RunWithOptions, ShellCompletion, ShowDefaultOptions, SocketAddressOptions, SocketAddressValue, SourceContext, StringOptions, SubstituteParserValue, Suggestion, TupleOptions, UrlOptions, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, type ValueSetOptions, WithDefaultError, WithDefaultOptions, annotationKey, argument, bash, choice, cidr, command, commandLine, concat, conditional, constant, createDeferredParseState, createDependencySourceState, createPendingDependencySourceState, defaultValues, deferredParseMarker, dependency, dependencyId, dependencyIds, dependencySourceMarker, dependencySourceStateMarker, deriveFrom, deriveFromAsync, deriveFromSync, derivedValueParserMarker, domain, email, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDependencyError, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getAnnotations, getDefaultValuesFunction, getDependencyIds, getDocPage, getDocPageAsync, getDocPageSync, group, hostname, integer, ip, ipv4, ipv6, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isNonEmptyString, isPendingDependencySourceState, isValueParser, isWrappedDependencySource, link, locale, longestMatch, macAddress, map, merge, message, metavar, multiple, nonEmpty, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, parseWithDependency, passThrough, pendingDependencySourceStateMarker, port, portRange, pwsh, runParser, runParserAsync, runParserSync, runWith, runWithAsync, runWithSync, socketAddress, string, suggest, suggestAsync, suggestSync, suggestWithDependency, text, transformsDependencyValue, transformsDependencyValueMarker, tuple, url, uuid, value, valueSet, values, withDefault, wrappedDependencySourceMarker, zsh };
|
|
15
|
+
export { type Annotations, AnyDependencySource, ArgumentErrorOptions, ArgumentOptions, ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, CidrOptions, CidrValue, CombineMode, CombineModes, CombinedDependencyMode, CommandErrorOptions, CommandOptions, CompletionHelpVisibility, CompletionName, ConditionalErrorOptions, ConditionalOptions, DeferredParseState, DependencyError, DependencyMode, DependencyRegistry, DependencySource, DependencySourceState, DependencyValue, DependencyValues, DeriveAsyncOptions, DeriveFromAsyncOptions, DeriveFromOptions, DeriveFromSyncOptions, DeriveOptions, DeriveSyncOptions, DerivedValueParser, DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, DocState, DomainOptions, DuplicateOptionError, EmailOptions, ExtractRequiredOptions, FlagErrorOptions, FlagOptions, FloatOptions, HostnameOptions, InferMode, InferValue, IntegerOptionsBigInt, IntegerOptionsNumber, IpOptions, Ipv4Options, Ipv6Options, LocaleOptions, LongestMatchErrorOptions, LongestMatchOptions, MacAddressOptions, MergeOptions, type Message, type MessageFormatOptions, type MessageTerm, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, NonEmptyString, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionName, OptionOptions, OptionState, OrErrorOptions, OrOptions, type ParseOptions, Parser, ParserContext, ParserResult, ParserValuePlaceholder, PassThroughFormat, PassThroughOptions, PendingDependencySourceState, PortOptionsBigInt, PortOptionsNumber, PortRangeOptionsBigInt, PortRangeOptionsNumber, PortRangeValueBigInt, PortRangeValueNumber, ResolvedDependency, Result, RunOptions, RunParserError, RunWithOptions, ShellCompletion, ShowDefaultOptions, SocketAddressOptions, SocketAddressValue, SourceContext, StringOptions, SubstituteParserValue, Suggestion, TupleOptions, UrlOptions, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, type ValueSetOptions, WithDefaultError, WithDefaultOptions, annotationKey, argument, bash, choice, cidr, command, commandLine, concat, conditional, constant, createDeferredParseState, createDependencySourceState, createPendingDependencySourceState, defaultValues, deferredParseMarker, dependency, dependencyId, dependencyIds, dependencySourceMarker, dependencySourceStateMarker, deriveFrom, deriveFromAsync, deriveFromSync, derivedValueParserMarker, domain, email, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDependencyError, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getAnnotations, getDefaultValuesFunction, getDependencyIds, getDocPage, getDocPageAsync, getDocPageSync, group, hostname, integer, ip, ipv4, ipv6, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isNonEmptyString, isPendingDependencySourceState, isValueParser, isWrappedDependencySource, lineBreak, link, locale, longestMatch, macAddress, map, merge, message, metavar, multiple, nonEmpty, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, parseWithDependency, passThrough, pendingDependencySourceStateMarker, port, portRange, pwsh, runParser, runParserAsync, runParserSync, runWith, runWithAsync, runWithSync, socketAddress, string, suggest, suggestAsync, suggestSync, suggestWithDependency, text, transformsDependencyValue, transformsDependencyValueMarker, tuple, url, uuid, value, valueSet, values, withDefault, wrappedDependencySourceMarker, zsh };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Annotations, ParseOptions, annotationKey, getAnnotations } from "./annotations.js";
|
|
2
2
|
import { NonEmptyString, ensureNonEmptyString, isNonEmptyString } from "./nonempty.js";
|
|
3
|
-
import { Message, MessageFormatOptions, MessageTerm, ValueSetOptions, commandLine, envVar, formatMessage, link, message, metavar, optionName, optionNames, text, value, valueSet, values } from "./message.js";
|
|
3
|
+
import { Message, MessageFormatOptions, MessageTerm, ValueSetOptions, commandLine, envVar, formatMessage, lineBreak, link, message, metavar, optionName, optionNames, text, value, valueSet, values } from "./message.js";
|
|
4
4
|
import { OptionName, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, extractArgumentMetavars, extractCommandNames, extractOptionNames, formatUsage, formatUsageTerm, normalizeUsage } from "./usage.js";
|
|
5
5
|
import { DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, ShowDefaultOptions, formatDocPage } from "./doc.js";
|
|
6
6
|
import { ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, CidrOptions, CidrValue, DomainOptions, EmailOptions, FloatOptions, HostnameOptions, IntegerOptionsBigInt, IntegerOptionsNumber, IpOptions, Ipv4Options, Ipv6Options, LocaleOptions, MacAddressOptions, PortOptionsBigInt, PortOptionsNumber, PortRangeOptionsBigInt, PortRangeOptionsNumber, PortRangeValueBigInt, PortRangeValueNumber, SocketAddressOptions, SocketAddressValue, StringOptions, UrlOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, choice, cidr, domain, email, float, hostname, integer, ip, ipv4, ipv6, isValueParser, locale, macAddress, port, portRange, socketAddress, string, url, uuid } from "./valueparser.js";
|
|
@@ -12,4 +12,4 @@ import { CombineModes, DocState, InferMode, InferValue, Mode, ModeIterable, Mode
|
|
|
12
12
|
import { ShellCompletion, bash, fish, nu, pwsh, zsh } from "./completion.js";
|
|
13
13
|
import { ParserValuePlaceholder, SourceContext } from "./context.js";
|
|
14
14
|
import { CompletionHelpVisibility, CompletionName, ExtractRequiredOptions, RunOptions, RunParserError, RunWithOptions, SubstituteParserValue, runParser, runParserAsync, runParserSync, runWith, runWithAsync, runWithSync } from "./facade.js";
|
|
15
|
-
export { type Annotations, AnyDependencySource, ArgumentErrorOptions, ArgumentOptions, ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, CidrOptions, CidrValue, CombineMode, CombineModes, CombinedDependencyMode, CommandErrorOptions, CommandOptions, CompletionHelpVisibility, CompletionName, ConditionalErrorOptions, ConditionalOptions, DeferredParseState, DependencyError, DependencyMode, DependencyRegistry, DependencySource, DependencySourceState, DependencyValue, DependencyValues, DeriveAsyncOptions, DeriveFromAsyncOptions, DeriveFromOptions, DeriveFromSyncOptions, DeriveOptions, DeriveSyncOptions, DerivedValueParser, DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, DocState, DomainOptions, DuplicateOptionError, EmailOptions, ExtractRequiredOptions, FlagErrorOptions, FlagOptions, FloatOptions, HostnameOptions, InferMode, InferValue, IntegerOptionsBigInt, IntegerOptionsNumber, IpOptions, Ipv4Options, Ipv6Options, LocaleOptions, LongestMatchErrorOptions, LongestMatchOptions, MacAddressOptions, MergeOptions, type Message, type MessageFormatOptions, type MessageTerm, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, NonEmptyString, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionName, OptionOptions, OptionState, OrErrorOptions, OrOptions, type ParseOptions, Parser, ParserContext, ParserResult, ParserValuePlaceholder, PassThroughFormat, PassThroughOptions, PendingDependencySourceState, PortOptionsBigInt, PortOptionsNumber, PortRangeOptionsBigInt, PortRangeOptionsNumber, PortRangeValueBigInt, PortRangeValueNumber, ResolvedDependency, Result, RunOptions, RunParserError, RunWithOptions, ShellCompletion, ShowDefaultOptions, SocketAddressOptions, SocketAddressValue, SourceContext, StringOptions, SubstituteParserValue, Suggestion, TupleOptions, UrlOptions, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, type ValueSetOptions, WithDefaultError, WithDefaultOptions, annotationKey, argument, bash, choice, cidr, command, commandLine, concat, conditional, constant, createDeferredParseState, createDependencySourceState, createPendingDependencySourceState, defaultValues, deferredParseMarker, dependency, dependencyId, dependencyIds, dependencySourceMarker, dependencySourceStateMarker, deriveFrom, deriveFromAsync, deriveFromSync, derivedValueParserMarker, domain, email, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDependencyError, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getAnnotations, getDefaultValuesFunction, getDependencyIds, getDocPage, getDocPageAsync, getDocPageSync, group, hostname, integer, ip, ipv4, ipv6, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isNonEmptyString, isPendingDependencySourceState, isValueParser, isWrappedDependencySource, link, locale, longestMatch, macAddress, map, merge, message, metavar, multiple, nonEmpty, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, parseWithDependency, passThrough, pendingDependencySourceStateMarker, port, portRange, pwsh, runParser, runParserAsync, runParserSync, runWith, runWithAsync, runWithSync, socketAddress, string, suggest, suggestAsync, suggestSync, suggestWithDependency, text, transformsDependencyValue, transformsDependencyValueMarker, tuple, url, uuid, value, valueSet, values, withDefault, wrappedDependencySourceMarker, zsh };
|
|
15
|
+
export { type Annotations, AnyDependencySource, ArgumentErrorOptions, ArgumentOptions, ChoiceOptions, ChoiceOptionsBase, ChoiceOptionsNumber, ChoiceOptionsString, CidrOptions, CidrValue, CombineMode, CombineModes, CombinedDependencyMode, CommandErrorOptions, CommandOptions, CompletionHelpVisibility, CompletionName, ConditionalErrorOptions, ConditionalOptions, DeferredParseState, DependencyError, DependencyMode, DependencyRegistry, DependencySource, DependencySourceState, DependencyValue, DependencyValues, DeriveAsyncOptions, DeriveFromAsyncOptions, DeriveFromOptions, DeriveFromSyncOptions, DeriveOptions, DeriveSyncOptions, DerivedValueParser, DocEntry, DocFragment, DocFragments, DocPage, DocPageFormatOptions, DocSection, DocState, DomainOptions, DuplicateOptionError, EmailOptions, ExtractRequiredOptions, FlagErrorOptions, FlagOptions, FloatOptions, HostnameOptions, InferMode, InferValue, IntegerOptionsBigInt, IntegerOptionsNumber, IpOptions, Ipv4Options, Ipv6Options, LocaleOptions, LongestMatchErrorOptions, LongestMatchOptions, MacAddressOptions, MergeOptions, type Message, type MessageFormatOptions, type MessageTerm, Mode, ModeIterable, ModeValue, MultipleErrorOptions, MultipleOptions, NoMatchContext, NonEmptyString, ObjectErrorOptions, ObjectOptions, OptionErrorOptions, OptionName, OptionOptions, OptionState, OrErrorOptions, OrOptions, type ParseOptions, Parser, ParserContext, ParserResult, ParserValuePlaceholder, PassThroughFormat, PassThroughOptions, PendingDependencySourceState, PortOptionsBigInt, PortOptionsNumber, PortRangeOptionsBigInt, PortRangeOptionsNumber, PortRangeValueBigInt, PortRangeValueNumber, ResolvedDependency, Result, RunOptions, RunParserError, RunWithOptions, ShellCompletion, ShowDefaultOptions, SocketAddressOptions, SocketAddressValue, SourceContext, StringOptions, SubstituteParserValue, Suggestion, TupleOptions, UrlOptions, Usage, UsageFormatOptions, UsageTerm, UsageTermFormatOptions, Uuid, UuidOptions, ValueParser, ValueParserResult, type ValueSetOptions, WithDefaultError, WithDefaultOptions, annotationKey, argument, bash, choice, cidr, command, commandLine, concat, conditional, constant, createDeferredParseState, createDependencySourceState, createPendingDependencySourceState, defaultValues, deferredParseMarker, dependency, dependencyId, dependencyIds, dependencySourceMarker, dependencySourceStateMarker, deriveFrom, deriveFromAsync, deriveFromSync, derivedValueParserMarker, domain, email, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDependencyError, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getAnnotations, getDefaultValuesFunction, getDependencyIds, getDocPage, getDocPageAsync, getDocPageSync, group, hostname, integer, ip, ipv4, ipv6, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isNonEmptyString, isPendingDependencySourceState, isValueParser, isWrappedDependencySource, lineBreak, link, locale, longestMatch, macAddress, map, merge, message, metavar, multiple, nonEmpty, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, parseWithDependency, passThrough, pendingDependencySourceStateMarker, port, portRange, pwsh, runParser, runParserAsync, runParserSync, runWith, runWithAsync, runWithSync, socketAddress, string, suggest, suggestAsync, suggestSync, suggestWithDependency, text, transformsDependencyValue, transformsDependencyValueMarker, tuple, url, uuid, value, valueSet, values, withDefault, wrappedDependencySourceMarker, zsh };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { annotationKey, getAnnotations } from "./annotations.js";
|
|
2
|
-
import { commandLine, envVar, formatMessage, link, message, metavar, optionName, optionNames, text, value, valueSet, values } from "./message.js";
|
|
2
|
+
import { commandLine, envVar, formatMessage, lineBreak, link, message, metavar, optionName, optionNames, text, value, valueSet, values } from "./message.js";
|
|
3
3
|
import { bash, fish, nu, pwsh, zsh } from "./completion.js";
|
|
4
4
|
import { DependencyRegistry, createDeferredParseState, createDependencySourceState, createPendingDependencySourceState, defaultValues, deferredParseMarker, dependency, dependencyId, dependencyIds, dependencySourceMarker, dependencySourceStateMarker, deriveFrom, deriveFromAsync, deriveFromSync, derivedValueParserMarker, formatDependencyError, getDefaultValuesFunction, getDependencyIds, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isPendingDependencySourceState, isWrappedDependencySource, parseWithDependency, pendingDependencySourceStateMarker, suggestWithDependency, transformsDependencyValue, transformsDependencyValueMarker, wrappedDependencySourceMarker } from "./dependency.js";
|
|
5
5
|
import { extractArgumentMetavars, extractCommandNames, extractOptionNames, formatUsage, formatUsageTerm, normalizeUsage } from "./usage.js";
|
|
@@ -12,4 +12,4 @@ import { argument, command, constant, flag, option, passThrough } from "./primit
|
|
|
12
12
|
import { getDocPage, getDocPageAsync, getDocPageSync, parse, parseAsync, parseSync, suggest, suggestAsync, suggestSync } from "./parser.js";
|
|
13
13
|
import { RunParserError, runParser, runParserAsync, runParserSync, runWith, runWithAsync, runWithSync } from "./facade.js";
|
|
14
14
|
|
|
15
|
-
export { DependencyRegistry, DuplicateOptionError, RunParserError, WithDefaultError, annotationKey, argument, bash, choice, cidr, command, commandLine, concat, conditional, constant, createDeferredParseState, createDependencySourceState, createPendingDependencySourceState, defaultValues, deferredParseMarker, dependency, dependencyId, dependencyIds, dependencySourceMarker, dependencySourceStateMarker, deriveFrom, deriveFromAsync, deriveFromSync, derivedValueParserMarker, domain, email, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDependencyError, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getAnnotations, getDefaultValuesFunction, getDependencyIds, getDocPage, getDocPageAsync, getDocPageSync, group, hostname, integer, ip, ipv4, ipv6, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isNonEmptyString, isPendingDependencySourceState, isValueParser, isWrappedDependencySource, link, locale, longestMatch, macAddress, map, merge, message, metavar, multiple, nonEmpty, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, parseWithDependency, passThrough, pendingDependencySourceStateMarker, port, portRange, pwsh, runParser, runParserAsync, runParserSync, runWith, runWithAsync, runWithSync, socketAddress, string, suggest, suggestAsync, suggestSync, suggestWithDependency, text, transformsDependencyValue, transformsDependencyValueMarker, tuple, url, uuid, value, valueSet, values, withDefault, wrappedDependencySourceMarker, zsh };
|
|
15
|
+
export { DependencyRegistry, DuplicateOptionError, RunParserError, WithDefaultError, annotationKey, argument, bash, choice, cidr, command, commandLine, concat, conditional, constant, createDeferredParseState, createDependencySourceState, createPendingDependencySourceState, defaultValues, deferredParseMarker, dependency, dependencyId, dependencyIds, dependencySourceMarker, dependencySourceStateMarker, deriveFrom, deriveFromAsync, deriveFromSync, derivedValueParserMarker, domain, email, ensureNonEmptyString, envVar, extractArgumentMetavars, extractCommandNames, extractOptionNames, fish, flag, float, formatDependencyError, formatDocPage, formatMessage, formatUsage, formatUsageTerm, getAnnotations, getDefaultValuesFunction, getDependencyIds, getDocPage, getDocPageAsync, getDocPageSync, group, hostname, integer, ip, ipv4, ipv6, isDeferredParseState, isDependencySource, isDependencySourceState, isDerivedValueParser, isNonEmptyString, isPendingDependencySourceState, isValueParser, isWrappedDependencySource, lineBreak, link, locale, longestMatch, macAddress, map, merge, message, metavar, multiple, nonEmpty, normalizeUsage, nu, object, option, optionName, optionNames, optional, or, parse, parseAsync, parseSync, parseWithDependency, passThrough, pendingDependencySourceStateMarker, port, portRange, pwsh, runParser, runParserAsync, runParserSync, runWith, runWithAsync, runWithSync, socketAddress, string, suggest, suggestAsync, suggestSync, suggestWithDependency, text, transformsDependencyValue, transformsDependencyValueMarker, tuple, url, uuid, value, valueSet, values, withDefault, wrappedDependencySourceMarker, zsh };
|
package/dist/message.cjs
CHANGED
|
@@ -140,6 +140,18 @@ function commandLine(commandLine$1) {
|
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
|
+
* Creates a {@link MessageTerm} for an explicit single-line break.
|
|
144
|
+
*
|
|
145
|
+
* Unlike single `\n` in `text()` terms (which are treated as soft breaks and
|
|
146
|
+
* normalized to spaces), this term always renders as a hard line break.
|
|
147
|
+
*
|
|
148
|
+
* @returns A {@link MessageTerm} representing an explicit line break.
|
|
149
|
+
* @since 0.10.0
|
|
150
|
+
*/
|
|
151
|
+
function lineBreak() {
|
|
152
|
+
return { type: "lineBreak" };
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
143
155
|
* Creates a {@link MessageTerm} for a URL.
|
|
144
156
|
* @param url The URL, which can be a URL object or a string that can be parsed
|
|
145
157
|
* as a URL. For example, `"https://example.com"` or
|
|
@@ -332,7 +344,11 @@ function formatMessage(msg, options = {}) {
|
|
|
332
344
|
text: useColors ? `\x1b[36m${cmd}${resetSequence}` : cmd,
|
|
333
345
|
width: cmd.length
|
|
334
346
|
};
|
|
335
|
-
} else if (term.type === "
|
|
347
|
+
} else if (term.type === "lineBreak") yield {
|
|
348
|
+
text: "\n",
|
|
349
|
+
width: -1
|
|
350
|
+
};
|
|
351
|
+
else if (term.type === "url") {
|
|
336
352
|
const urlString = term.url.href;
|
|
337
353
|
const displayText = useQuotes ? `<${urlString}>` : urlString;
|
|
338
354
|
if (useColors) {
|
|
@@ -369,6 +385,7 @@ function formatMessage(msg, options = {}) {
|
|
|
369
385
|
exports.commandLine = commandLine;
|
|
370
386
|
exports.envVar = envVar;
|
|
371
387
|
exports.formatMessage = formatMessage;
|
|
388
|
+
exports.lineBreak = lineBreak;
|
|
372
389
|
exports.link = link;
|
|
373
390
|
exports.message = message;
|
|
374
391
|
exports.metavar = metavar;
|
package/dist/message.d.cts
CHANGED
|
@@ -123,6 +123,15 @@ type MessageTerm =
|
|
|
123
123
|
*/
|
|
124
124
|
readonly commandLine: string;
|
|
125
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* An explicit single-line break term in the message.
|
|
128
|
+
* @since 0.10.0
|
|
129
|
+
*/ | {
|
|
130
|
+
/**
|
|
131
|
+
* The type of the term, which is `"lineBreak"` for an explicit line break.
|
|
132
|
+
*/
|
|
133
|
+
readonly type: "lineBreak";
|
|
134
|
+
}
|
|
126
135
|
/**
|
|
127
136
|
* A URL term in the message, which represents a clickable hyperlink.
|
|
128
137
|
* @since 0.10.0
|
|
@@ -223,6 +232,16 @@ declare function envVar(envVar: string): MessageTerm;
|
|
|
223
232
|
* @since 0.6.0
|
|
224
233
|
*/
|
|
225
234
|
declare function commandLine(commandLine: string): MessageTerm;
|
|
235
|
+
/**
|
|
236
|
+
* Creates a {@link MessageTerm} for an explicit single-line break.
|
|
237
|
+
*
|
|
238
|
+
* Unlike single `\n` in `text()` terms (which are treated as soft breaks and
|
|
239
|
+
* normalized to spaces), this term always renders as a hard line break.
|
|
240
|
+
*
|
|
241
|
+
* @returns A {@link MessageTerm} representing an explicit line break.
|
|
242
|
+
* @since 0.10.0
|
|
243
|
+
*/
|
|
244
|
+
declare function lineBreak(): MessageTerm;
|
|
226
245
|
/**
|
|
227
246
|
* Creates a {@link MessageTerm} for a URL.
|
|
228
247
|
* @param url The URL, which can be a URL object or a string that can be parsed
|
|
@@ -361,4 +380,4 @@ interface MessageFormatOptions {
|
|
|
361
380
|
*/
|
|
362
381
|
declare function formatMessage(msg: Message, options?: MessageFormatOptions): string;
|
|
363
382
|
//#endregion
|
|
364
|
-
export { Message, MessageFormatOptions, MessageTerm, ValueSetOptions, commandLine, envVar, formatMessage, link, message, metavar, optionName, optionNames, text, url, value, valueSet, values };
|
|
383
|
+
export { Message, MessageFormatOptions, MessageTerm, ValueSetOptions, commandLine, envVar, formatMessage, lineBreak, link, message, metavar, optionName, optionNames, text, url, value, valueSet, values };
|
package/dist/message.d.ts
CHANGED
|
@@ -123,6 +123,15 @@ type MessageTerm =
|
|
|
123
123
|
*/
|
|
124
124
|
readonly commandLine: string;
|
|
125
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* An explicit single-line break term in the message.
|
|
128
|
+
* @since 0.10.0
|
|
129
|
+
*/ | {
|
|
130
|
+
/**
|
|
131
|
+
* The type of the term, which is `"lineBreak"` for an explicit line break.
|
|
132
|
+
*/
|
|
133
|
+
readonly type: "lineBreak";
|
|
134
|
+
}
|
|
126
135
|
/**
|
|
127
136
|
* A URL term in the message, which represents a clickable hyperlink.
|
|
128
137
|
* @since 0.10.0
|
|
@@ -223,6 +232,16 @@ declare function envVar(envVar: string): MessageTerm;
|
|
|
223
232
|
* @since 0.6.0
|
|
224
233
|
*/
|
|
225
234
|
declare function commandLine(commandLine: string): MessageTerm;
|
|
235
|
+
/**
|
|
236
|
+
* Creates a {@link MessageTerm} for an explicit single-line break.
|
|
237
|
+
*
|
|
238
|
+
* Unlike single `\n` in `text()` terms (which are treated as soft breaks and
|
|
239
|
+
* normalized to spaces), this term always renders as a hard line break.
|
|
240
|
+
*
|
|
241
|
+
* @returns A {@link MessageTerm} representing an explicit line break.
|
|
242
|
+
* @since 0.10.0
|
|
243
|
+
*/
|
|
244
|
+
declare function lineBreak(): MessageTerm;
|
|
226
245
|
/**
|
|
227
246
|
* Creates a {@link MessageTerm} for a URL.
|
|
228
247
|
* @param url The URL, which can be a URL object or a string that can be parsed
|
|
@@ -361,4 +380,4 @@ interface MessageFormatOptions {
|
|
|
361
380
|
*/
|
|
362
381
|
declare function formatMessage(msg: Message, options?: MessageFormatOptions): string;
|
|
363
382
|
//#endregion
|
|
364
|
-
export { Message, MessageFormatOptions, MessageTerm, ValueSetOptions, commandLine, envVar, formatMessage, link, message, metavar, optionName, optionNames, text, url, value, valueSet, values };
|
|
383
|
+
export { Message, MessageFormatOptions, MessageTerm, ValueSetOptions, commandLine, envVar, formatMessage, lineBreak, link, message, metavar, optionName, optionNames, text, url, value, valueSet, values };
|
package/dist/message.js
CHANGED
|
@@ -139,6 +139,18 @@ function commandLine(commandLine$1) {
|
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
|
+
* Creates a {@link MessageTerm} for an explicit single-line break.
|
|
143
|
+
*
|
|
144
|
+
* Unlike single `\n` in `text()` terms (which are treated as soft breaks and
|
|
145
|
+
* normalized to spaces), this term always renders as a hard line break.
|
|
146
|
+
*
|
|
147
|
+
* @returns A {@link MessageTerm} representing an explicit line break.
|
|
148
|
+
* @since 0.10.0
|
|
149
|
+
*/
|
|
150
|
+
function lineBreak() {
|
|
151
|
+
return { type: "lineBreak" };
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
142
154
|
* Creates a {@link MessageTerm} for a URL.
|
|
143
155
|
* @param url The URL, which can be a URL object or a string that can be parsed
|
|
144
156
|
* as a URL. For example, `"https://example.com"` or
|
|
@@ -331,7 +343,11 @@ function formatMessage(msg, options = {}) {
|
|
|
331
343
|
text: useColors ? `\x1b[36m${cmd}${resetSequence}` : cmd,
|
|
332
344
|
width: cmd.length
|
|
333
345
|
};
|
|
334
|
-
} else if (term.type === "
|
|
346
|
+
} else if (term.type === "lineBreak") yield {
|
|
347
|
+
text: "\n",
|
|
348
|
+
width: -1
|
|
349
|
+
};
|
|
350
|
+
else if (term.type === "url") {
|
|
335
351
|
const urlString = term.url.href;
|
|
336
352
|
const displayText = useQuotes ? `<${urlString}>` : urlString;
|
|
337
353
|
if (useColors) {
|
|
@@ -365,4 +381,4 @@ function formatMessage(msg, options = {}) {
|
|
|
365
381
|
}
|
|
366
382
|
|
|
367
383
|
//#endregion
|
|
368
|
-
export { commandLine, envVar, formatMessage, link, message, metavar, optionName, optionNames, text, url, value, valueSet, values };
|
|
384
|
+
export { commandLine, envVar, formatMessage, lineBreak, link, message, metavar, optionName, optionNames, text, url, value, valueSet, values };
|