feat: Adds dump-configuration command.

This commit is contained in:
2024-12-16 20:44:30 -05:00
parent f89efc8c5e
commit 99459a0a71
7 changed files with 45 additions and 9 deletions

View File

@@ -0,0 +1,27 @@
import ArgumentParser
import CliDoc
import ConfigurationClient
import CustomDump
import Dependencies
struct DumpConfigCommand: AsyncParsableCommand {
static let commandName = "dump-config"
static let configuration = CommandConfiguration(
commandName: commandName,
abstract: createAbstract("Show the current configuration."),
usage: .default(commandName: commandName, parentCommand: "utils", usesArguments: false, usesExtraArguments: false),
discussion: Discussion {
"Useful to debug your configuration settings / make sure they load properly."
}
)
func run() async throws {
@Dependency(\.configurationClient) var configurationClient
let configuration = try await configurationClient.findAndLoad()
customDump(configuration)
}
}

View File

@@ -10,6 +10,7 @@ struct UtilsCommand: AsyncParsableCommand {
These are commands that are generally only run on occasion / less frequently used.
""",
subcommands: [
DumpConfigCommand.self,
GenerateProjectTemplateCommand.self,
GenerateConfigurationCommand.self,
InstallDependenciesCommand.self