Skip to content

Generate command models from argument parser info JSON files #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
May 25, 2025

Conversation

cmcgee1024
Copy link
Member

@cmcgee1024 cmcgee1024 commented May 7, 2025

Instead of hand-crafting the helper functions, options, and structs for each command,
describe the command structure using an argument parser compatible JSON format
for each command. Introduce a generator plugin that generates all of the Swift types in
a manner that is similar to the way that they were hand-written before.

There are certain limitations in the JSON schema for the Swift argument parser that
prevent the generator from knowing certain important details. For example, there is
no information on which arguments contain file paths, which is important information
for type safety in this context. For this information, and more potentially in the future
introduce a "-ext.json" file with an extension schema to hold the extra information.

@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

@cmcgee1024 cmcgee1024 marked this pull request as ready for review May 23, 2025 02:05
@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

@cmcgee1024 cmcgee1024 merged commit 5508505 into swiftlang:main May 25, 2025
24 checks passed
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