Skip to content

Add --target and --filter options to export command#28

Merged
Malcolmnixon merged 1 commit into
mainfrom
feature/export-target-filter
Jul 12, 2026
Merged

Add --target and --filter options to export command#28
Malcolmnixon merged 1 commit into
mainfrom
feature/export-target-filter

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

This pull request adds significant new features and documentation updates to the sysml2tools export command, introducing support for restricting export output to a containment subtree via --target and for narrowing results with a filter expression via --filter. The changes also clarify error handling and update requirements and help documentation to reflect these enhancements.

New export command features:

  • Added --target <qualified-name> option to restrict export output to the containment subtree rooted at a specified element. If the target is a usage/feature, its resolved type's subtree is also included. A clear error is reported if the target does not resolve to a visible declaration (either absent or stdlib-hidden), and no export is produced in that case. [1] [2] [3] [4]
  • Added --filter <expr> option to narrow exported declarations and edges using a Phase 1 filter-expression, applied after --target scoping. If the filter expression cannot be parsed, the export falls back to the unfiltered (but still target-scoped, if applicable) result, with a synthetic warning diagnostic in the output and a console warning. [1] [2] [3] [4]

Documentation and requirements updates:

  • Updated user guide and README with examples and option descriptions for --target and --filter, including command-line usage and help output. [1] [2] [3]
  • Expanded the design documentation to describe the command semantics, error handling, and implementation details for the new options, including the rationale for duplication of subtree logic and filter evaluation. [1] [2] [3] [4]
  • Updated requirements YAML to specify acceptance and test cases for the new --target and --filter options, including error conditions and composition order. [1] [2] [3]

These changes make the export command more flexible and robust, allowing users and downstream tools to extract focused slices of a model and apply complex filtering directly at export time.

Adds containment-subtree scoping (--target) and filter-expression narrowing
(--filter) to the export command, mirroring render's dynamic-view scoping
and filter subsystems. --target resolves to a subtree (with usage-to-type
expansion), --filter applies Core.Filtering's public parser/evaluator, and
the two compose target-then-filter with dual-endpoint edge inclusion.
Unresolved/stdlib-hidden targets produce a clean error; unparseable filter
expressions fall back to the unfiltered (target-scoped) result with a
synthetic diagnostic and console warning.

Updates companion docs (design, reqstream, verification, README, user
guide, roadmap) and adds parser/subsystem/integration tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Malcolmnixon
Malcolmnixon merged commit 6a9af85 into main Jul 12, 2026
15 checks passed
@Malcolmnixon
Malcolmnixon deleted the feature/export-target-filter branch July 12, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant