[PR #935] [MERGED] Turn CLI commands into objects, statically register subcommands #813

Closed
opened 2025-12-30 01:26:58 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/935
Author: @bioball
Created: 2/5/2025
Status: Merged
Merged: 2/5/2025
Merged by: @bioball

Base: mainHead: polish-subcommands


📝 Commits (1)

  • 7f9e125 Turn CLI commands into objects, statically register subcommands

📊 Changes

15 files changed (+223 additions, -247 deletions)

View changed files

📝 pkl-cli/src/main/kotlin/org/pkl/cli/Main.kt (+2 -18)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/AnalyzeCommand.kt (+27 -29)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/DownloadPackageCommand.kt (+5 -5)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/EvalCommand.kt (+8 -12)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/ProjectCommand.kt (+106 -108)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/ReplCommand.kt (+3 -7)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/RootCommand.kt (+18 -4)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/ServerCommand.kt (+3 -3)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/TestCommand.kt (+3 -3)
📝 pkl-cli/src/test/kotlin/org/pkl/cli/CliMainTest.kt (+17 -16)
📝 pkl-cli/src/test/kotlin/org/pkl/cli/CliTestRunnerTest.kt (+4 -12)
📝 pkl-codegen-java/src/main/kotlin/org/pkl/codegen/java/Main.kt (+13 -13)
📝 pkl-codegen-kotlin/src/main/kotlin/org/pkl/codegen/kotlin/Main.kt (+10 -10)
📝 pkl-doc/src/main/kotlin/org/pkl/doc/Main.kt (+2 -2)
📝 pkl-doc/src/test/kotlin/org/pkl/doc/CliMainTest.kt (+2 -5)

📄 Description

This is a minor improvement: all Command are now objects, and they register their own subcommands.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/935 **Author:** [@bioball](https://github.com/bioball) **Created:** 2/5/2025 **Status:** ✅ Merged **Merged:** 2/5/2025 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `polish-subcommands` --- ### 📝 Commits (1) - [`7f9e125`](https://github.com/apple/pkl/commit/7f9e125e43b2272dbdb0855429750987889ba38c) Turn CLI commands into objects, statically register subcommands ### 📊 Changes **15 files changed** (+223 additions, -247 deletions) <details> <summary>View changed files</summary> 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/Main.kt` (+2 -18) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/AnalyzeCommand.kt` (+27 -29) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/DownloadPackageCommand.kt` (+5 -5) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/EvalCommand.kt` (+8 -12) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/ProjectCommand.kt` (+106 -108) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/ReplCommand.kt` (+3 -7) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/RootCommand.kt` (+18 -4) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/ServerCommand.kt` (+3 -3) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/TestCommand.kt` (+3 -3) 📝 `pkl-cli/src/test/kotlin/org/pkl/cli/CliMainTest.kt` (+17 -16) 📝 `pkl-cli/src/test/kotlin/org/pkl/cli/CliTestRunnerTest.kt` (+4 -12) 📝 `pkl-codegen-java/src/main/kotlin/org/pkl/codegen/java/Main.kt` (+13 -13) 📝 `pkl-codegen-kotlin/src/main/kotlin/org/pkl/codegen/kotlin/Main.kt` (+10 -10) 📝 `pkl-doc/src/main/kotlin/org/pkl/doc/Main.kt` (+2 -2) 📝 `pkl-doc/src/test/kotlin/org/pkl/doc/CliMainTest.kt` (+2 -5) </details> ### 📄 Description This is a minor improvement: all `Command` are now objects, and they register their own subcommands. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:26:58 +01:00
adam closed this issue 2025-12-30 01:26:58 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#813