The examples in Examples/CommandLineToolSupport demonstrate how to model existing command-line tools in Swift. They live in the dedicated CommandLineToolSupportExamples target and are dependencies of the command-line support test target. Consequently, every swift test compile-checks them without pretending that declarations alone are behavioral tests.
ExampleUsage.swiftcontains compile-checked call sites that configure, compose, select, and resolve representative tools.ExampleSwiftTool.swiftis the broad baseline: parent-local options, subcommands, inverted and counted flags, option separators, repeated single-value options, typed values, and positional operands.ExampleGitTool.swiftdemonstrates parent and final-command placement, optional inversion, nested subcommands, URL values, and typed option values.ExampleGitHubReleaseTool.swiftdemonstrates deeply nested subcommands and conditional argument selection for release notes.ExampleXcrunTool.swiftdemonstrates selected-tool hosting, including a selected tool with its own subcommands.ExampleXcodebuildInvocationSummaryTool.swiftdemonstrates advanced invocation summaries, inherited parent arguments, conditional applicability, and post-resolution rewrite rules.ExampleDocumentationCompilerTool.swiftdemonstrates operation-dependent argument ordering withSwitch,Case,DefaultCase, andWhen.ExampleInvocationSummaryApplicabilityContrastTool.swiftcontrasts explicit summary nodes with modifier-based omission and unavailability.ExampleStatefulCommandTools.swiftmodels tools whose arguments form mutually exclusive operational modes.ExamplePlainSubcommandTool.swiftdemonstrates subcommand declarations whose nested tools rely on synthesized conformance.ExampleSandboxExecTool.swiftdemonstrates a trailing arbitrary argument vector and composing one modeled tool inside another.ExampleXcbeautifyTool.swiftdemonstrates the output-formatter tool protocol.
These are illustrative declarations rather than fake tests. Behavioral coverage belongs in Tests/CommandLineSupport; example coverage belongs here.