mirror of
https://github.com/morluto/rea.git
synced 2026-11-23 23:15:58 +00:00
feat(errors): carry related parameters and operations and derive CLI flags and commands (#11777)
* feat(errors): carry related parameters and operations and derive CLI flags and commands * fix(cli,errors): preserve operation-selector flags in CLI hints and clarify snapshot load/save
This commit is contained in:
1 parent
ddd0d6d4a4
commit
d5a942177f
25 files changed
+679
-68
No files matched your search
@@ -686,11 +686,13 @@ export const registerContractCommand = <
|
||||
if (!opening.ok) return projectAnalysisError(opening.error);
|
||||
// A composed command also takes its sources' options; a control
|
||||
// its result records from a source is set by that option.
|
||||
const operations = contractDescriptionOperations(selected);
|
||||
const resultBinding =
|
||||
description.evidenceTargets === undefined
|
||||
? selected.inputBinding
|
||||
? { ...selected.inputBinding, operations }
|
||||
: {
|
||||
...selected.inputBinding,
|
||||
operations,
|
||||
flags: {
|
||||
...description.evidenceTargets.sourceFlags,
|
||||
...selected.inputBinding.flags,
|
||||
@@ -746,11 +748,14 @@ export const registerContractCommand = <
|
||||
},
|
||||
} as never,
|
||||
{
|
||||
operations: distinctOperations(
|
||||
[description, ...chosen.values()].flatMap(
|
||||
contractDescriptionOperations,
|
||||
operations: distinctOperations([
|
||||
...contractDescriptionOperations(description),
|
||||
...[...chosen.entries()].flatMap(([value, choice]) =>
|
||||
contractDescriptionOperations(choice, {
|
||||
selector: `--${optionFlagName(projection.operationBy!.option)} ${String(value)}`,
|
||||
}),
|
||||
),
|
||||
),
|
||||
]),
|
||||
source: { kind: "contract", description },
|
||||
},
|
||||
);
|
||||
@@ -1027,7 +1032,10 @@ export const registerRoutedCommand = (
|
||||
),
|
||||
}),
|
||||
description.contract.outputSchema,
|
||||
description.inputBinding,
|
||||
{
|
||||
...description.inputBinding,
|
||||
operations: contractDescriptionOperations(description),
|
||||
},
|
||||
);
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user