Description
Inventory exact long-option prefix candidates and ambiguities under an explicit option-name bank; no abbreviation acceptance policy.
An argv vector already consists of literal argument strings. Shell quoting and tokenization happen before this representation; joining argv elements with spaces does not reconstruct a safe command string. Option aliases, duplicates, arity and dependencies are application policies that these tools take explicitly.
Inventory exact long-option prefix candidates and ambiguities under an explicit option-name bank; no abbreviation acceptance policy.
When to use this tool
Use this tool to inventory exact long-option prefix candidates and ambiguities under an explicit option-name bank; no abbreviation acceptance policy.
How to use the tool and how it works
- Enter prefixes, options using the input definitions below.
- Run the operation. Resolve malformed-input errors before interpreting the result.
- Read result.matches. Interpret signs, units, ordering and null values using the rules below.
Require distinct option-bank strings and nonempty prefixes. For each prefix return every case-sensitive startsWith match in bank order and ambiguous = matchCount>1.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| prefixes | Nonempty exact prefixes to look up in the supplied option bank. | Dense list of at most 128 strings, each at most 8,192 UTF-16 code units. |
| options | Distinct case-sensitive option-bank strings, in candidate order. | Dense list of at most 128 strings, each at most 8,192 UTF-16 code units. |
| Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.matches | One prefix record per input, with bank-ordered matches and ambiguity flag. |
{
"input": {
"prefixes": [
"ver",
"v"
],
"options": [
"version",
"verbose",
"quiet"
]
},
"output": {
"result": {
"matches": [
{
"prefix": "ver",
"options": [
"version",
"verbose"
],
"ambiguous": true
},
{
"prefix": "v",
"options": [
"version",
"verbose"
],
"ambiguous": true
}
]
}
}
} Limitations and assumptions
- The bank strings are caller-defined; a single candidate does not automatically authorize abbreviated option syntax.
- Inputs are literal tokens or explicit records. The restricted long-name grammar is [A-Za-z0-9][A-Za-z0-9-]* where required. No universal option syntax, shell semantics or process execution is inferred.
- Every declared top-level input is required and unknown fields are rejected. Ordinary strings are limited to 8,192 UTF-16 code units and lists to 128 entries, with tighter operation-specific bounds where stated. JSON text has bounded nesting and node counts.
- Numeric outputs must be finite and within the absolute safe-integer magnitude; exact larger integers use decimal text. Source positions are zero-based UTF-16 offsets and span ends are exclusive unless a different convention is explicitly stated.
Alternative or Complementary methods
Use the application’s option schema to choose arity, aliases and conflict policy. Pass a literal argv vector to the intended process interface; shell command construction requires separate quoting rules.
References
Similar or alternative tools
- Long Option Assignment Joiner
Format one literal long-option argv token under a restricted ASCII option-name grammar; returns one argument, not shell quoting.
- Long Option Assignment Splitter
Split one strict ASCII --long-name[=value] argv token at the first equals; no shell parsing or implicit next-token consumption.