Description
Check explicit one-way option presence dependencies without adding transitive inferred options or applying defaults.
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.
Check explicit one-way option presence dependencies without adding transitive inferred options or applying defaults.
When to use this tool
Use this tool to check explicit one-way option presence dependencies without adding transitive inferred options or applying defaults.
How to use the tool and how it works
- Enter present, dependenciesJson using the input definitions below. Serialize the JSON text fields in the decoded shape shown below.
- Run the operation. Resolve malformed-input errors before interpreting the result.
- Read result.violations. Interpret signs, units, ordering and null values using the rules below.
For every explicit {option,requires} relation, return it when option is present and requires is absent. Preserve dependency-record order.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| present | Exact names recorded as present, without implicit defaults. | Dense list of at most 128 strings, each at most 8,192 UTF-16 code units. |
| dependenciesJson | JSON array of {option,requires} exact string-name relations. | Text, at most 8,192 UTF-16 code units; the stated grammar and narrower limits also apply. |
These decoded examples show the structure of the JSON text fields. Supply each as its corresponding serialized JSON string.
{
"dependenciesJson": [
{
"option": "a",
"requires": "b"
}
]
} | Output field | Interpretation |
|---|---|
| result | Object containing the fields below. |
| result.violations | Source-indexed arity/group violations or missing dependency records, as specified above. |
{
"input": {
"present": [
"a"
],
"dependenciesJson": "[{\"option\":\"a\",\"requires\":\"b\"}]"
},
"output": {
"result": {
"violations": [
{
"option": "a",
"requires": "b"
}
]
}
}
} Limitations and assumptions
- Dependencies are one-way presence checks; the tool does not add transitive/default options or inspect their values.
- 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.