mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 22:36:08 +00:00
fix(cli): guide delimited analysis view exports (#8730)
Co-authored-by: hhang <169027046+xu91102@users.noreply.github.com>
This commit is contained in:
1 parent
1df7ac9320
commit
f8ec48095a
3 files changed
+19
-2
No files matched your search
+4
-1
@@ -1196,9 +1196,12 @@ treated as malformed.
|
||||
exact array path with `--filter-output` and provide comma-separated direct
|
||||
scalar columns with `--columns`; column order is the output column order:
|
||||
|
||||
For an artifact inventory request that selects the `occurrences` collection
|
||||
and includes `logical_path` and `artifact_id` in its view fields:
|
||||
|
||||
```bash
|
||||
rea inspect-analysis-view request.json --format csv \
|
||||
--filter-output normalized_result.rows --columns name,address
|
||||
--filter-output normalized_result.items --columns logical_path,artifact_id
|
||||
```
|
||||
|
||||
The first line is a REA metadata record,
|
||||
|
||||
@@ -73,7 +73,7 @@ export const registerAnalysisViewCommands = (
|
||||
});
|
||||
cli.command(CLI_COMMANDS.inspectAnalysisView, {
|
||||
description:
|
||||
"Project a selected view of completed Evidence JSON for a supported analysis operation",
|
||||
"Project a selected view of completed Evidence JSON for a supported analysis operation. For inventory rows, use --format csv or --format tsv with --filter-output normalized_result.items and --columns logical_path,artifact_id (if those fields are included in the view).",
|
||||
args: z.object({
|
||||
inputJson: z.string().describe("Inline workflow JSON or JSON file path"),
|
||||
}),
|
||||
|
||||
@@ -7,6 +7,20 @@ import { ARTIFACT_COMPARISON_EXAMPLE } from "../../../src/contracts/artifactComp
|
||||
import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js";
|
||||
import { cliTest } from "../../support/cli/cliFixture.js";
|
||||
|
||||
cliTest(
|
||||
"shows how to export inventory rows in command help",
|
||||
async ({ cli }) => {
|
||||
const result = await cli.run({
|
||||
arguments: ["inspect-analysis-view", "--help"],
|
||||
});
|
||||
expect(result.exitCode).toBe(0);
|
||||
expect(result.stdout).toContain("--format csv");
|
||||
expect(result.stdout).toContain("--format tsv");
|
||||
expect(result.stdout).toContain("--filter-output normalized_result.items");
|
||||
expect(result.stdout).toContain("--columns logical_path,artifact_id");
|
||||
},
|
||||
);
|
||||
|
||||
cliTest(
|
||||
"exports selected artifact inventory columns through the public CLI",
|
||||
async ({ cli }) => {
|
||||
|
||||
Reference in new issue
Block a user